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

🐞 Destination S3 & GCS Avro: support array with unknown item type #9367

Merged
merged 14 commits into from
Jan 12, 2022

Conversation

tuliren
Copy link
Contributor

@tuliren tuliren commented Jan 9, 2022

What

  • When the array field has an items property, but the property is empty (i.e. without a type specification), the Json to Avro schema converter will throw exception.
  • This PR defaults such array to an array of strings.
  • This PR also defaults any kind of exception to the string schema. We should not see errors from the Json to Avro schema converter any more.
  • Resolve 🐛 Source Slack: more specific typing required for pending_shared field #9252.

🚨 User Impact 🚨

This PR should not affect any existing connections.

Pre-merge Checklist

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

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
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here

@github-actions github-actions bot added the area/connectors Connector related issues label Jan 9, 2022
@tuliren tuliren changed the title Support array field with empty items specification 🐞 Destination S3 & GCS: support array with unknown item type Jan 9, 2022
@tuliren tuliren requested review from alafanechere and edgao January 9, 2022 19:49
@tuliren tuliren temporarily deployed to more-secrets January 9, 2022 19:51 Inactive
@tuliren tuliren temporarily deployed to more-secrets January 9, 2022 19:57 Inactive
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Jan 9, 2022
@tuliren tuliren temporarily deployed to more-secrets January 9, 2022 20:01 Inactive
@tuliren
Copy link
Contributor Author

tuliren commented Jan 9, 2022

/test connector=connectors/destination-s3

🕑 connectors/destination-s3 https://github.com/airbytehq/airbyte/actions/runs/1674755083
✅ connectors/destination-s3 https://github.com/airbytehq/airbyte/actions/runs/1674755083
No Python unittests run

@tuliren
Copy link
Contributor Author

tuliren commented Jan 9, 2022

/test connector=connectors/destination-gcs

🕑 connectors/destination-gcs https://github.com/airbytehq/airbyte/actions/runs/1674755215
✅ connectors/destination-gcs https://github.com/airbytehq/airbyte/actions/runs/1674755215
No Python unittests run

@tuliren
Copy link
Contributor Author

tuliren commented Jan 9, 2022

/test connector=connectors/destination-bigquery

🕑 connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/1674756397
❌ connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/1674756397
🐛

🕑 connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/1674756397
✅ connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/1674756397
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    13      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     155      8    95%
	 normalization/transform_catalog/reserved_keywords.py                 13      0   100%
	 normalization/transform_catalog/stream_processor.py                 520    333    36%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         148     34    77%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1258    525    58%

@tuliren
Copy link
Contributor Author

tuliren commented Jan 9, 2022

/test connector=connectors/destination-bigquery-denormalized

🕑 connectors/destination-bigquery-denormalized https://github.com/airbytehq/airbyte/actions/runs/1674756187
❌ connectors/destination-bigquery-denormalized https://github.com/airbytehq/airbyte/actions/runs/1674756187
🐛

🕑 connectors/destination-bigquery-denormalized https://github.com/airbytehq/airbyte/actions/runs/1674756187
❌ connectors/destination-bigquery-denormalized https://github.com/airbytehq/airbyte/actions/runs/1674756187
🐛

🕑 connectors/destination-bigquery-denormalized https://github.com/airbytehq/airbyte/actions/runs/1674756187
❌ connectors/destination-bigquery-denormalized https://github.com/airbytehq/airbyte/actions/runs/1674756187
🐛

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 9, 2022 20:03 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 9, 2022 20:03 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 9, 2022 20:03 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 9, 2022 20:04 Inactive
@tuliren tuliren temporarily deployed to more-secrets January 9, 2022 20:09 Inactive
@tuliren tuliren temporarily deployed to more-secrets January 10, 2022 00:01 Inactive
@tuliren
Copy link
Contributor Author

tuliren commented Jan 10, 2022

Integration test failed due to Could not find image: airbyte/normalization:dev. I wonder if this is due to insufficient disk space of our Github runner.

Copy link
Contributor

@edgao edgao left a comment

Choose a reason for hiding this comment

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

Should the json/avro conversion doc also mention that any errors will default to string-type? (everything else seems fine!)

docs/integrations/destinations/bigquery.md Outdated Show resolved Hide resolved
@tuliren tuliren temporarily deployed to more-secrets January 10, 2022 04:06 Inactive
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.

LGTM, thank you for the fix!

@tuliren tuliren temporarily deployed to more-secrets January 12, 2022 06:37 Inactive
@tuliren tuliren changed the title 🐞 Destination S3 & GCS: support array with unknown item type 🐞 Destination S3 & GCS Avro: support array with unknown item type Jan 12, 2022
@tuliren
Copy link
Contributor Author

tuliren commented Jan 12, 2022

/publish connector=connectors/destination-s3

🕑 connectors/destination-s3 https://github.com/airbytehq/airbyte/actions/runs/1686288639
✅ connectors/destination-s3 https://github.com/airbytehq/airbyte/actions/runs/1686288639

@tuliren
Copy link
Contributor Author

tuliren commented Jan 12, 2022

/publish connector=connectors/destination-gcs

🕑 connectors/destination-gcs https://github.com/airbytehq/airbyte/actions/runs/1686288720
✅ connectors/destination-gcs https://github.com/airbytehq/airbyte/actions/runs/1686288720

@tuliren tuliren temporarily deployed to more-secrets January 12, 2022 06:44 Inactive
@tuliren tuliren temporarily deployed to more-secrets January 12, 2022 06:46 Inactive
@tuliren tuliren temporarily deployed to more-secrets January 12, 2022 07:09 Inactive
@@ -3594,8 +3594,6 @@
\ more memory. Allowed values: min=5MB, max=525MB Default: 5MB."
type: "integer"
default: 5
minimum: 5
maximum: 525
Copy link
Contributor Author

@tuliren tuliren Jan 12, 2022

Choose a reason for hiding this comment

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

I am really confused why the spec changed. I did not touch the spec.json at all. Also it does not seem that any recent PR has removed these fields. Actually these fields should not exist in the first place.

@tuliren tuliren merged commit 5f6785d into master Jan 12, 2022
@tuliren tuliren deleted the liren/support-json-items-without-type branch January 12, 2022 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Source Slack: more specific typing required for pending_shared field
4 participants