-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
CAT: add validation for stream statuses #34675
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Source Google sheets FAILED as was predicted in #33565 (comment) : airbyte-ci connectors --name=source-google-sheets test --only-step="acceptance" --acceptance.-k=test_read Source Klaviyo: SUCCEEDED |
# Conflicts: # airbyte-integrations/bases/connector-acceptance-test/CHANGELOG.md
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.
This looks good to me. @maxi297 does this unblock your work for Stripe? Should we merge it today then?
@@ -136,7 +131,7 @@ def test_verify_records_schema(configured_catalog: ConfiguredAirbyteCatalog): | |||
) | |||
def test_verify_records_schema_with_fail_on_extra_columns(configured_catalog: ConfiguredAirbyteCatalog, json_schema, record, should_fail): | |||
"""Test that fail_on_extra_columns works correctly with nested objects, array of objects""" | |||
configured_catalog.streams[0].stream.json_schema =json_schema |
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.
Out of curiosity, what formatter do you personally use, and what formatter does most of the team have?
@alafanechere works on setting up requirements on new PRs including type checks with mypy, and I'm considering a formatter as well.
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.
what formatter do you personally use?
Mainly airbyte-ci format fix all
(but it is needed to remove unit_test folder from excluded list in pyproject.toml
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.
@natikgadzhi we already have a repo wide formatter (airbyte-ci format fix all/python/js/java
) which runs in CI.
We can double the same rules at the connector level if we want to localize the formatting.
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 would like to understand the deploy process for this change
@@ -188,6 +188,7 @@ class BasicReadTestConfig(BaseConfig): | |||
) | |||
expect_records: Optional[ExpectedRecordsConfig] = Field(description="Expected records from the read") | |||
validate_schema: bool = Field(True, description="Ensure that records match the schema of the corresponding stream") | |||
validate_stream_statuses: bool = Field(True, description="Ensure that all streams emit status messages") |
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.
This means that it is a breaking change. What is the plan for updating the sources so that CATs pass after this is merged?
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.
We expect that all certified connectors will pass this test.
What is the plan for updating the sources so that CATs pass after this is merged?
Our connector-health engineer will take care of it.
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.
Can you be more explicit about this? I want to understand is CATs will be red for a while. We have a goal for Q1 which is to have CATs be green for certified connectors. This includes having a process which ensure that connectors are passing CATs
To answer @natikgadzhi on #34675 (review): No it does not as the change that affected my PR is not related to this. I've tried to remove the validation but not CATs are failing for another reason. I'll work on unblocking some people on other issues and I'll come back to that |
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.
Can you please address those concerns?
@@ -188,6 +188,7 @@ class BasicReadTestConfig(BaseConfig): | |||
) | |||
expect_records: Optional[ExpectedRecordsConfig] = Field(description="Expected records from the read") | |||
validate_schema: bool = Field(True, description="Ensure that records match the schema of the corresponding stream") | |||
validate_stream_statuses: bool = Field(True, description="Ensure that all streams emit status messages") |
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.
Can you be more explicit about this? I want to understand is CATs will be red for a while. We have a goal for Q1 which is to have CATs be green for certified connectors. This includes having a process which ensure that connectors are passing CATs
...te-integrations/bases/connector-acceptance-test/connector_acceptance_test/tests/test_core.py
Outdated
Show resolved
Hide resolved
if not inputs.validate_stream_statuses and test_strictness_level is Config.TestStrictnessLevel.high: | ||
pytest.fail("High strictness level error: validate_stream_statuses must be set to true in the basic read test configuration.") | ||
else: | ||
return inputs.validate_stream_statuses |
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.
There is a grooming note that mentions that we should not apply this by default for community connectors. Right now, the default value for validate_stream_statuses
is True. Does isn't that contradictory?
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.
fixed, this test will not run if ql < 400
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.
With the new change, does that mean that if we want to enable this for ql < 400
, we just can't? It feels like we should be able to test this even if the connector is ql < 400
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 this case, do we need to set it to False
as default, and force to True
for certified (ql > 400
) connectors?
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.
Can we set it to "None" so that we have three states:
- Not explicitly defined which means ql > 400 are enabled but not the rest
- False would fail for ql > 400 but skip for non-certified
- True would work for everyone
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.
Good point!
fixed.
...te-integrations/bases/connector-acceptance-test/connector_acceptance_test/tests/test_core.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/bases/connector-acceptance-test/unit_tests/test_core.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/bases/connector-acceptance-test/unit_tests/test_core.py
Show resolved
Hide resolved
@maxi297 ,
I think all certified connectors should be good with this test, otherwise we had to check them and fix or skip this test. |
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.
One last comment and I think I'm good
if not inputs.validate_stream_statuses and test_strictness_level is Config.TestStrictnessLevel.high: | ||
pytest.fail("High strictness level error: validate_stream_statuses must be set to true in the basic read test configuration.") | ||
else: | ||
return inputs.validate_stream_statuses |
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.
With the new change, does that mean that if we want to enable this for ql < 400
, we just can't? It feels like we should be able to test this even if the connector is ql < 400
# Conflicts: # airbyte-integrations/bases/connector-acceptance-test/CHANGELOG.md
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.
🚢
What
Resolve #33565
How
add validation for stream statuses
Recommended reading order
airbyte-integrations/bases/connector-acceptance-test/connector_acceptance_test/tests/test_core.py
🚨 User Impact 🚨
no breaking changes
Pre-merge Actions
Updating the Python CDK
Airbyter
Before merging:
--use-local-cdk --name=source-<connector>
as optionsairbyte-ci connectors --use-local-cdk --name=source-<connector> test
After merging: