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
Issue 32871/test other incremental stripe stream #33544
Issue 32871/test other incremental stripe stream #33544
Conversation
…t_other_incremental_stripe_stream
…t_other_incremental_stripe_stream
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Before Merging a Connector Pull RequestWow! What a great pull request you have here! 🎉 To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
…t_other_incremental_stripe_stream
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.
just a few comments lgtm!
# request matched http_mocker | ||
|
||
@HttpMocker() | ||
def test_when_read_then_add_cursor_field(self, http_mocker: HttpMocker) -> None: |
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.
nit: from looking at the code, it looks like the stream is adding the "legacy cursor field" to the record
airbyte-integrations/connectors/source-stripe/unit_tests/integration/test_authorizations.py
Show resolved
Hide resolved
airbyte-integrations/connectors/source-stripe/unit_tests/integration/test_authorizations.py
Show resolved
Hide resolved
# request matched http_mocker | ||
|
||
@HttpMocker() | ||
def test_when_read_then_add_cursor_field(self, http_mocker: HttpMocker) -> None: |
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.
def test_when_read_then_add_cursor_field(self, http_mocker: HttpMocker) -> None: | |
def test_when_read_then_add_created_cursor_field(self, http_mocker: HttpMocker) -> None: |
or
def test_when_read_then_add_cursor_field(self, http_mocker: HttpMocker) -> None: | |
def test_when_read_then_add_legacy_cursor_field(self, http_mocker: HttpMocker) -> None: |
?
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.
Given this comment and the current one, my answer would be:
Can you expand on that? My understanding is that when this stream was moved to the events stream, the cursor field was changed to updated
. However, the records on the authorizations
endpoint does not have this field so we backfill it. Hence, when we read without a state (which leads us to query the authorizations
endpoint), we have to set the updated
as this is the cursor field. Note that this logic is creating invalid cursor fields and there was a ticket created for that
EDIT: I'll continue my merge sequence but will come back to comment if we perform any changes regarding this on another PR
airbyte-integrations/connectors/source-stripe/unit_tests/integration/test_cards.py
Show resolved
Hide resolved
airbyte-integrations/connectors/source-stripe/unit_tests/integration/test_reviews.py
Show resolved
Hide resolved
airbyte-integrations/connectors/source-stripe/unit_tests/integration/test_reviews.py
Show resolved
Hide resolved
airbyte-integrations/connectors/source-stripe/unit_tests/integration/test_reviews.py
Show resolved
Hide resolved
338901b
into
issue-32871/test_application_fees
What
Following the tests for application_fees, there are a couple of streams which share the same behavior.
How
This PR mostly copy/paste the test for application_fees to apply them to the following streams:
Note
There was a discussion about if we should use inheritance to have less code to maintain for tests. We decided not to go that way for now because:
The drawback of the current solution is that when we change the behavior in
IncrementalStripeStream
for example, the behavior probably needs to be updated for all the tests for streams that implements IncrementalStripeStream. This would lead to more maintenance if the change is non-breaking in regards to the test class API. For example, if the test requires new information, the amount of work would be comparable for both solution has the dev will have to go in all the tests to update them with the new information any. If a test is added and is leveraging information that is available in all the child test classes, now the current solution would require more work to maintain.I'm willing to reconsider the final decision if there are strong opinions on this