-
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 FivetranEventIterator #26396
[dagster-fivetran] Implement FivetranEventIterator #26396
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4c1fef8
to
49c4665
Compare
49c4665
to
969b992
Compare
T = TypeVar("T", bound=FivetranEventType) | ||
|
||
|
||
class FivetranEventIterator(Generic[T], abc.Iterator): |
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.
suprised we're using abc.Iterator and not typing.Iterator?
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.
wait why is this an abstract base class? We're instantiating it right?
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 a good call. I replicated what we already have for other integrations - DbtEventIterator, DltEventIterator and SlingEventIterator are all subclassing abc.Iterator
- but I agree that subclassing typing.Iterator makes much more sense. Will fix here and open PRs to update the other integrations.
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 0582d6f
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.
confused why / how this works. Feels like it should be subclassing iterator with a specific type, not creating a generic subclass
969b992
to
0582d6f
Compare
## Summary & Motivation Subclass `typing.Iterator` instead of `abc.Iterator` in `DbtEventIterator`. This is motivated by [this discussion](#26396 (comment)). ## How I Tested These Changes Same tests with BK
T = TypeVar("T", bound=FivetranEventType) | ||
|
||
|
||
class FivetranEventIterator(Generic[T], Iterator): |
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.
Should be Iterator[T] as well right
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.
heed comment but thx
0582d6f
to
d5e4a25
Compare
…o#26424) ## Summary & Motivation Subclass `typing.Iterator` instead of `abc.Iterator` in `DbtEventIterator`. This is motivated by [this discussion](dagster-io#26396 (comment)). ## How I Tested These Changes Same tests with BK
## Summary & Motivation This PR adds at basic `FivetranEventIterator` that wraps materializations yielded by `FivetranWorkspace.sync_and_poll`. This `FivetranEventIterator` will be used to implement fetch_column_metadata in the next stacked PR. ## How I Tested These Changes Existing tests with BK
Summary & Motivation
This PR adds at basic
FivetranEventIterator
that wraps materializations yielded byFivetranWorkspace.sync_and_poll
. ThisFivetranEventIterator
will be used to implement fetch_column_metadata in the next stacked PR.How I Tested These Changes
Existing tests with BK