marcosmarxm commented on code in PR #41122:
URL: https://github.com/apache/airflow/pull/41122#discussion_r1712689660


##########
airflow/providers/airbyte/operators/airbyte.py:
##########
@@ -73,47 +74,39 @@ def __init__(
         self.connection_id = connection_id
         self.timeout = timeout
         self.api_version = api_version
-        self.api_type = api_type
         self.wait_seconds = wait_seconds
         self.asynchronous = asynchronous
         self.deferrable = deferrable
 
     def execute(self, context: Context) -> None:
         """Create Airbyte Job and wait to finish."""
-        hook = AirbyteHook(
-            airbyte_conn_id=self.airbyte_conn_id, 
api_version=self.api_version, api_type=self.api_type
-        )
+        hook = AirbyteHook(airbyte_conn_id=self.airbyte_conn_id, 
api_version=self.api_version)
         job_object = 
hook.submit_sync_connection(connection_id=self.connection_id)
-        if self.api_type == "config":
-            self.job_id = job_object.json()["job"]["id"]
-            state = job_object.json()["job"]["status"]
-        else:
-            self.job_id = job_object.json()["jobId"]
-            state = job_object.json()["status"]
+        self.job_id = job_object.job_id
+        state = job_object.status
         end_time = time.time() + self.timeout

Review Comment:
   Awesome! Thanks for the suggestion @Imbruced function looks way easier to 
understand.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to