diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py index fa86acbffa20e..50349698a6537 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py @@ -695,8 +695,9 @@ def poll_sync( """ poll_start = datetime.now() while True: + connector_details = self.get_connector_details(connector_id) connector = FivetranConnector.from_connector_details( - connector_details=self.get_connector_details(connector_id) + connector_details=connector_details ) self._log.info(f"Polled '{connector_id}'. Status: [{connector.sync_state}]") @@ -712,16 +713,15 @@ def poll_sync( # Sleep for the configured time interval before polling again. time.sleep(poll_interval) - post_raw_connector_details = self.get_connector_details(connector_id) if not connector.is_last_sync_successful: raise Failure( f"Sync for connector '{connector_id}' failed!", metadata={ - "connector_details": MetadataValue.json(post_raw_connector_details), + "connector_details": MetadataValue.json(connector_details), "log_url": MetadataValue.url(connector.url), }, ) - return post_raw_connector_details + return connector_details @experimental diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py index ff77c6e46d0de..0d9fa410226a0 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py @@ -67,4 +67,4 @@ def test_basic_resource_request( client.poll_sync( connector_id=connector_id, previous_sync_completed_at=parser.parse(MIN_TIME_STR) ) - assert len(all_api_mocks.calls) == 2 + assert len(all_api_mocks.calls) == 1