-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dagster-fivetran] Implement base poll method in FivetranClient #26060
[dagster-fivetran] Implement base poll method in FivetranClient #26060
Conversation
python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py
Outdated
Show resolved
Hide resolved
cadbe37
to
90123af
Compare
469b919
to
6fff27d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accepting but see comment
if connector.last_sync_completed_at > previous_sync_completed_at: | ||
break | ||
|
||
if poll_timeout and datetime.now() > poll_start + timedelta(seconds=poll_timeout): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[1]
# Sleep for the configured time interval before polling again. | ||
time.sleep(poll_interval) | ||
|
||
if not connector.is_last_sync_successful: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[2]
@@ -59,3 +61,10 @@ def test_basic_resource_request( | |||
client.start_resync(connector_id=connector_id, resync_parameters={"property1": ["string"]}) | |||
assert len(all_api_mocks.calls) == 3 | |||
assert f"{connector_id}/schemas/tables/resync" in all_api_mocks.calls[2].request.url | |||
|
|||
# poll calls | |||
all_api_mocks.calls.reset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this is just re-originating a method that exists prior to this PR, but I'm just looking at all the unexercised code paths [1] and [2]; would be nice to test failure conditions here if it's not hard. Won't block review on that, especially since the problem exists beyond just this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's totally fair - done in a55e620
90123af
to
b81d516
Compare
6fff27d
to
77163b2
Compare
b81d516
to
004f258
Compare
77163b2
to
a55e620
Compare
004f258
to
03b4f71
Compare
a55e620
to
7ff0145
Compare
FivetranWorkspaceData
to FivetranConnectorTableProps
method
#25797
03b4f71
to
6855c14
Compare
3bdb351
to
0d4c5c3
Compare
6855c14
to
2021ba0
Compare
0d4c5c3
to
919e38e
Compare
2021ba0
to
3df2067
Compare
919e38e
to
b85bbe8
Compare
3df2067
to
22bfe6c
Compare
b85bbe8
to
c7250c1
Compare
22bfe6c
to
ffab308
Compare
c7250c1
to
9161976
Compare
ffab308
to
16121e5
Compare
9161976
to
13b8e6d
Compare
16121e5
to
8a48241
Compare
13b8e6d
to
f039336
Compare
f039336
to
4b0d41a
Compare
Summary & Motivation
This PR reworks legacy oll method and implements it in the
FivetranClient
:poll_sync
is added based on legacypoll_sync
FivetranConnector
propertiesTests mock the request API calls and make sure that all calls are made.
How I Tested These Changes
Additional unit tests with BK