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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAT: set additionalProperties recursively for objects #34448

Merged
merged 9 commits into from
Jan 29, 2024

Conversation

artem1205
Copy link
Collaborator

@artem1205 artem1205 commented Jan 23, 2024

What

Resolve #32191

How

Set additionalProperties recursively for objects inside jsonschema.
Skip objects if no properties are mentioned.

Recommended reading order

  1. airbyte-integrations/bases/connector-acceptance-test/connector_acceptance_test/utils/asserts.py
  2. airbyte-integrations/bases/connector-acceptance-test/unit_tests/test_asserts.py

馃毃 User Impact 馃毃

no breaking changes

Pre-merge Actions

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Unit & integration tests added

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.

Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git 鈫楋笌

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs 猬滐笍 Ignored (Inspect) Visit Preview Jan 29, 2024 4:58pm

@artem1205 artem1205 self-assigned this Jan 23, 2024
@artem1205 artem1205 marked this pull request as ready for review January 23, 2024 21:45
@artem1205 artem1205 requested review from a team and girarda January 23, 2024 21:45
@lazebnyi lazebnyi requested review from a team, brianjlai and maxi297 January 25, 2024 13:37
Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

Minor suggestion. Please update the CHANGELOG.md file

@@ -67,7 +90,7 @@ def verify_records_schema(
for stream in catalog.streams:
schema_to_validate_against = stream.stream.json_schema
if fail_on_extra_columns:
schema_to_validate_against = _enforce_no_additional_top_level_properties(schema_to_validate_against)
schema_to_validate_against = _enforce_false_additional_properties(schema_to_validate_against)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would find it more elegant to implement a custom Validator class which would enforce additional properties to false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agreed, moved schema transformation inside validator class

@artem1205 artem1205 merged commit dccb2fa into master Jan 29, 2024
21 checks passed
@artem1205 artem1205 deleted the artem1205/CAT-32191 branch January 29, 2024 17:11
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 21, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
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.

CAT verifying the schema of all records matches the connector's schema
3 participants