Skip to content

Commit 8aa974f

Browse files
authored
Merge pull request #46 from ecmwf-projects/remove-response-from-client
Remove response from client
2 parents 6dea6c3 + cd54c8c commit 8aa974f

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

ogc_api_processes_fastapi/clients.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def post_process_execute(
7474
process_id: str,
7575
execution_content: models.Execute,
7676
request: fastapi.Request,
77-
response: fastapi.Response,
7877
) -> models.StatusInfo:
7978
"""Post request for execution of the process identified by `process_id`.
8079
@@ -89,8 +88,6 @@ def post_process_execute(
8988
(e.g. inputs values).
9089
request: fastapi.Request
9190
Request.
92-
response: fastapi.Response
93-
Response.
9491
9592
Returns
9693
-------
@@ -121,7 +118,7 @@ def get_jobs(self) -> List[models.StatusInfo]:
121118
"""
122119

123120
@abc.abstractmethod
124-
def get_job(self, job_id: str, response: fastapi.Response) -> models.StatusInfo:
121+
def get_job(self, job_id: str) -> models.StatusInfo:
125122
"""Get status information of the job identified by `job_id`.
126123
127124
Called with `GET /jobs/{job_id}`.
@@ -130,8 +127,6 @@ def get_job(self, job_id: str, response: fastapi.Response) -> models.StatusInfo:
130127
----------
131128
job_id : str
132129
Identifier of the job.
133-
response: fastapi.Response
134-
Response.
135130
136131
Returns
137132
-------

ogc_api_processes_fastapi/routers.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,7 @@ def post_process_execute(
200200
) -> Any:
201201
"""Create a new job."""
202202
status_info = client.post_process_execute(
203-
process_id=process_id,
204-
execution_content=request_content,
205-
request=request,
206-
response=response,
203+
process_id=process_id, execution_content=request_content, request=request
207204
)
208205
status_info.links = [
209206
models.Link(
@@ -294,10 +291,9 @@ def create_get_job_endpoint(
294291
def get_job(
295292
job_id: str,
296293
request: fastapi.Request,
297-
response: fastapi.Response,
298294
) -> models.StatusInfo:
299295
"""Show the status of a job."""
300-
job = client.get_job(job_id=job_id, response=response)
296+
job = client.get_job(job_id=job_id)
301297
job.links = make_links_to_job(job=job, request=request)
302298

303299
return job

tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def post_process_execute(
6262
process_id: str,
6363
execution_content: models.Execute,
6464
request: fastapi.Request,
65-
response: fastapi.Response,
6665
) -> models.StatusInfo:
6766
status_info = models.StatusInfo(
6867
jobID=1, status=models.StatusCode.accepted, type=models.JobType.process
@@ -77,7 +76,7 @@ def get_jobs(self) -> List[models.StatusInfo]:
7776
]
7877
return jobs_list
7978

80-
def get_job(self, job_id: str, response: fastapi.Response) -> models.StatusInfo:
79+
def get_job(self, job_id: str) -> models.StatusInfo:
8180
status_info = models.StatusInfo(
8281
jobID=1, status=models.StatusCode.running, type=models.JobType.process
8382
)

0 commit comments

Comments
 (0)