-
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
[3/n][dagster-fivetran] Implement FivetranClient for rework #25756
Conversation
7c954b2
to
bbaf99d
Compare
da802b0
to
eb58403
Compare
bbaf99d
to
ed343b0
Compare
02ccc8d
to
3cedb5e
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.
Nice, looks good to me
67c556e
to
7197ca1
Compare
3cedb5e
to
93c3d6b
Compare
7197ca1
to
e21e3f0
Compare
93c3d6b
to
9a0a143
Compare
e21e3f0
to
6eb1099
Compare
9a0a143
to
e6d7f2d
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.
I won't block review on this, but I'd like to get your thoughts regarding testing strategy here.
One thing that we also started to do with dlift + airlift was have some test battery running live against the integration. IMO when a new person onboards to the integration, something like that is pretty invaluable in terms of getting started with the tooling, I will always trust it better than just pure unit tests especially when running against an external system which can change at any point. The _lack_of these I think is a major reason why we don't feel confidence in integrations which haven't been touched in a while. Doesn't have to be super complicated, but having a "kitchen sink" testbed for the integration similar to what we did for dlift/airlift: https://github.com/dagster-io/dagster/blob/master/examples/experimental/dagster-dlift/kitchen-sink/Makefile could be very nice. Then, you can leverage dagster-buildkite
to make it only run in the nightly + on PRs that touch integration code.
Thoughts?
@pytest.fixture( | ||
name="workspace_data_api_mocks_fn", | ||
) | ||
def workspace_data_api_mocks_fn_fixture( |
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.
In general I find API mocks like this to be relatively inflexible and hard to parse. How would you feel about instead implementing a "client fake" similar to how we did for airlift and dlift? Something like this:
https://github.com/dagster-io/dagster/blob/master/examples/experimental/dagster-dlift/dagster_dlift/test/client_fake.py
I've found it to be more composable and human-readable than mocking. I won't necessarily block review on this, but every time I've based a testing strategy around mocks I've regretted it. I assume this is also somewhat inherited from the old testing strategy, but I think if we're spending time in this code we might as well improve the situation.
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.
See comment in next PR
}, | ||
} | ||
|
||
SAMPLE_CONNECTOR_DETAILS = { |
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.
comment on how these were generated? What is our plan if the schema changes, etc?
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.
Updated in e4892e8
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.
Oops meant to approve.
6eb1099
to
5d21367
Compare
e6d7f2d
to
1461946
Compare
5d21367
to
fed3154
Compare
1846939
to
af34d01
Compare
af34d01
to
c714e38
Compare
I'm very much in favor of this strategy. I agree that unit tests mocking external services are not enough to make sure that the integration works properly. I'll open a ticket for that. |
Summary & Motivation
This PR implements
FivetranClient
, which is based on the legacyFivetranResource
code. Basically reusing howmake_request
was implemented and adding more methods to leverage in a subsequent PR to fetch the Fivetran workspace data.How I Tested These Changes
Additional unit test