Skip to content

Commit 17d77e8

Browse files
author
Oleksandr Bazarnov
committed
updated
1 parent 0f62848 commit 17d77e8

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

airbyte_cdk/sources/declarative/requesters/http_job_repository.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,14 @@ def _get_creation_response_interpolation_context(self, job: AsyncJob) -> Dict[st
284284
Dict[str, Any]: The interpolation context as a dictionary.
285285
"""
286286
creation_response_context = dict(self._create_job_response_by_id[job.api_job_id()].json())
287-
creation_response_context["headers"] = self._create_job_response_by_id[
288-
job.api_job_id()
289-
].headers
290-
creation_response_context["request"] = self._create_job_response_by_id[
291-
job.api_job_id()
292-
].request
287+
if not "headers" in creation_response_context:
288+
creation_response_context["headers"] = self._create_job_response_by_id[
289+
job.api_job_id()
290+
].headers
291+
if not "request" in creation_response_context:
292+
creation_response_context["request"] = self._create_job_response_by_id[
293+
job.api_job_id()
294+
].request
293295
return creation_response_context
294296

295297
def _get_polling_response_interpolation_context(self, job: AsyncJob) -> Dict[str, Any]:
@@ -303,12 +305,14 @@ def _get_polling_response_interpolation_context(self, job: AsyncJob) -> Dict[str
303305
Dict[str, Any]: The interpolation context as a dictionary.
304306
"""
305307
polling_response_context = dict(self._polling_job_response_by_id[job.api_job_id()].json())
306-
polling_response_context["headers"] = self._polling_job_response_by_id[
307-
job.api_job_id()
308-
].headers
309-
polling_response_context["request"] = self._polling_job_response_by_id[
310-
job.api_job_id()
311-
].request
308+
if not "headers" in polling_response_context:
309+
polling_response_context["headers"] = self._polling_job_response_by_id[
310+
job.api_job_id()
311+
].headers
312+
if not "request" in polling_response_context:
313+
polling_response_context["request"] = self._polling_job_response_by_id[
314+
job.api_job_id()
315+
].request
312316
return polling_response_context
313317

314318
def _get_create_job_stream_slice(self, job: AsyncJob) -> StreamSlice:

0 commit comments

Comments
 (0)