Skip to content
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

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

maximearmstrong
Copy link
Contributor

@maximearmstrong maximearmstrong commented Dec 10, 2024

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

T = TypeVar("T", bound=FivetranEventType)


class FivetranEventIterator(Generic[T], abc.Iterator):
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 0582d6f

Copy link
Contributor

@dpeng817 dpeng817 left a 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

@maximearmstrong maximearmstrong force-pushed the maxime/implement-fivetran-event-iterator branch from 969b992 to 0582d6f Compare December 12, 2024 01:59
maximearmstrong added a commit that referenced this pull request Dec 12, 2024
## 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):
Copy link
Contributor

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

Copy link
Contributor

@dpeng817 dpeng817 left a 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

@maximearmstrong maximearmstrong force-pushed the maxime/implement-fivetran-event-iterator branch from 0582d6f to d5e4a25 Compare December 12, 2024 19:55
@maximearmstrong maximearmstrong merged commit 5c7ca2c into master Dec 12, 2024
1 check passed
@maximearmstrong maximearmstrong deleted the maxime/implement-fivetran-event-iterator branch December 12, 2024 20:36
pskinnerthyme pushed a commit to pskinnerthyme/dagster that referenced this pull request Dec 16, 2024
…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
pskinnerthyme pushed a commit to pskinnerthyme/dagster that referenced this pull request Dec 16, 2024
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants