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

DAT: verify that a destination is able to write any ISO8601-compliant date string #9816

Merged
merged 24 commits into from
Apr 5, 2022

Conversation

yurii-bidiuk
Copy link
Contributor

@yurii-bidiuk yurii-bidiuk commented Jan 26, 2022

What

Fixes #5712

  1. To verify that a destination is able to write any ISO8601-compliant date we added new messages with date and date-time formats to edge_case_messages.txt.
  2. Destinations were able to process these messages but this occurs some errors on the assertions for acceptance tests. Some destinations process date/date-time in their specific format. For example, BigQuery destination converts a date-time string to a microsecond number. Some others destinations use different date-time formats to represent saved messages.
  3. destination-bigquery-denormalized wasn't able to process date-time strings for any ISO8691 format

How

  1. Added test cases with ISO date strings to edge_case_messages.txt.
  2. For destinations whose date-time representation was different from the initial format, added converters to convert from initial format to destination format (e.g. initial format: "2021-01-03T01:01:01.544+01:00", snowflake format: "2021-01-03T00:01:02Z". To apply this converter for some specific destination you need to for override method requiresDateTimeConversionForSync() for testSync() or requiresDateTimeConversionForNormalizedSync() for testSyncWithNormalization(). After that override convertDateTime() and implement logic for your destination. DateTimeUtils contains static methods that take string in ISO8691 format and return date-time string in format required for every specific destination. That's the reason why I added methods like convertTo...Format()
  3. Added method to parse any iso date-time and return date in the format that's applicable for bigquery-denormalized.

Recommended reading order

  1. edge_case_messages.txt
  2. DateTimeConverter.java
  3. DestinationAcceptanceTest.java
  4. DateTimeUtils.java
  5. BigQueryUtils.java

🚨 User Impact 🚨

There is no user impact

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? 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
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • 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 connector is published, connector added to connector index 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

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

Connector Generator

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed.

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1752060194

@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets January 26, 2022 17:08 Inactive
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-bigquery

🕑 connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/1752060832

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-redshift

🕑 connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/1752061937

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-postgres

🕑 connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/1752062505

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:10 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:11 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:11 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:11 Inactive
@github-actions github-actions bot added the area/connectors Connector related issues label Jan 26, 2022
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-snowflake

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

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-bigquery

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

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-redshift

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

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-postgres

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

@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets January 26, 2022 17:13 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:14 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:14 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:14 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:14 Inactive
@yurii-bidiuk yurii-bidiuk force-pushed the bidiuk/5712-dat-iso8601-compliant-date-strings branch from c7cb0e2 to 0d48b8f Compare January 26, 2022 17:29
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-snowflake

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

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-postgres

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

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-redshift

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

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Jan 26, 2022

/test connector=connectors/destination-bigquery

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

@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets January 26, 2022 17:31 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:32 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:32 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:32 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 17:32 Inactive
@yurii-bidiuk yurii-bidiuk force-pushed the bidiuk/5712-dat-iso8601-compliant-date-strings branch from 0d48b8f to 0c282fa Compare January 26, 2022 17:42
@yurii-bidiuk yurii-bidiuk force-pushed the bidiuk/5712-dat-iso8601-compliant-date-strings branch 2 times, most recently from 0ce9188 to 4640ad7 Compare April 4, 2022 21:37
github-actions bot referenced this pull request Apr 4, 2022
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Apr 5, 2022

/test connector=connectors/destination-pubsub

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

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Apr 5, 2022

/publish connector=connectors/destination-pubsub

🕑 connectors/destination-pubsub https://github.com/airbytehq/airbyte/actions/runs/2095169564
✅ connectors/destination-pubsub https://github.com/airbytehq/airbyte/actions/runs/2095169564

@yurii-bidiuk yurii-bidiuk force-pushed the bidiuk/5712-dat-iso8601-compliant-date-strings branch from 4640ad7 to cd04ca4 Compare April 5, 2022 09:15
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets April 5, 2022 10:38 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets April 5, 2022 10:38 Inactive
@yurii-bidiuk yurii-bidiuk merged commit 2f850b9 into master Apr 5, 2022
@yurii-bidiuk yurii-bidiuk deleted the bidiuk/5712-dat-iso8601-compliant-date-strings branch April 5, 2022 11:04
yurii-bidiuk added a commit that referenced this pull request Apr 7, 2022
yurii-bidiuk added a commit that referenced this pull request Apr 8, 2022
yurii-bidiuk added a commit that referenced this pull request Apr 8, 2022
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
8 participants