Skip to content

Destination-BigQuery: fixed table already exists error - #22497

Merged
Eugene (etsybaev) merged 13 commits into
masterfrom
etsybaev/22178-destination-bigquery-fixed-table-already-exists-err
Feb 9, 2023
Merged

Eugene (etsybaev) merged 13 commits into
masterfrom
etsybaev/22178-destination-bigquery-fixed-table-already-exists-err

Conversation

@etsybaev

Copy link
Copy Markdown
Contributor

What

Currently, Destination BigQuery will call the method createTableIfNotExist, however, there's no check for whether the table with the associated tableId exists before attempting to create the table. This results in connectors using BigQuery staging to see errors that a table "ALREADY EXISTS" despite not seeing this message in the past

How

Added verification of table already exists.

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

No breaking changes expected

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/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
  • If new credentials are required for use in CI, add them to GSM. 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
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command 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

@etsybaev

Eugene (etsybaev) commented Feb 7, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery

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

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 15      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    15      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     171      8    95%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         194     48    75%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         65     39    40%
normalization/transform_catalog/stream_processor.py                 595    400    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1457    630    57%

Build Passed

Test summary info:

All Passed

@github-actions

github-actions Bot commented Feb 7, 2023 •

Copy link
Copy Markdown
Contributor

Affected Connector Report

NOTE ⚠️ Changes in this PR affect the following connectors. Make sure to do the following as needed:

  • Run integration tests
  • Bump connector or module version
  • Add changelog
  • Publish the new version

✅ Sources (0)

Connector Version Changelog Publish
  • See "Actionable Items" below for how to resolve warnings and errors.

✅ Destinations (2)

Connector Version Changelog Publish
destination-bigquery 1.2.14 ✅ ✅
destination-bigquery-denormalized 1.2.14 ✅ ✅
  • See "Actionable Items" below for how to resolve warnings and errors.

👀 Other Modules (1)

  • base-normalization

Actionable Items

(click to expand)

Category Status Actionable Item
Version ❌
mismatch
The version of the connector is different from its normal variant. Please bump the version of the connector.
⚠
doc not found
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug.
Changelog ⚠
doc not found
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug.
❌
changelog missing
There is no chnagelog for the current version of the connector. If you are the author of the current version, please add a changelog.
Publish ⚠
not in seed
The connector is not in the seed file (e.g. source_definitions.yaml), so its publication status cannot be checked. This can be normal (e.g. some connectors are cloud-specific, and only listed in the cloud seed file). Please double-check to make sure that it is not a bug.
❌
diff seed version
The connector exists in the seed file, but the latest version is not listed there. This usually means that the latest version is not published. Please use the /publish command to publish the latest version.

@etsybaev
Eugene (etsybaev) marked this pull request as ready for review February 7, 2023 18:03
@etsybaev
Eugene (etsybaev) requested a review from a team as a code owner February 7, 2023 18:03
@etsybaev

Eugene (etsybaev) commented Feb 7, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery-denormalized

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

Build Passed

Test summary info:

All Passed

@etsybaev

Eugene (etsybaev) commented Feb 8, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery-denormalized

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

Build Passed

Test summary info:

All Passed

@etsybaev

Eugene (etsybaev) commented Feb 8, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery-denormalized

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

Build Passed

Test summary info:

All Passed

@octavia-squidington-iii Octavia Squidington III (octavia-squidington-iii) added the area/documentation Improvements or additions to documentation label Feb 8, 2023
@etsybaev

Eugene (etsybaev) commented Feb 8, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery-denormalized

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

Build Passed

Test summary info:

All Passed

@etsybaev

Eugene (etsybaev) commented Feb 8, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery-denormalized

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

Build Passed

Test summary info:

All Passed

@grishick

Copy link
Copy Markdown
Contributor

Eugene (@etsybaev) looks like /test is failing because QA checks require changelog to be updated. Can you bump connector version in Dockerfile, add changelog and re-run /test ?

@etsybaev

Eugene (etsybaev) commented Feb 9, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery-denormalized

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

Build Passed

Test summary info:

All Passed

@etsybaev

Eugene (etsybaev) commented Feb 9, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery-denormalized

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

Build Passed

Test summary info:

All Passed

@etsybaev

Eugene (etsybaev) commented Feb 9, 2023 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-bigquery-denormalized

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

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 15      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    15      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     171      8    95%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         194     48    75%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         65     39    40%
normalization/transform_catalog/stream_processor.py                 595    400    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1457    630    57%

Build Passed

Test summary info:

All Passed

@etsybaev

Eugene (etsybaev) commented Feb 9, 2023 •

Copy link
Copy Markdown
Contributor Author

/publish connector=connectors/destination-bigquery

🕑 Publishing the following connectors:
connectors/destination-bigquery
https://github.com/airbytehq/airbyte/actions/runs/4134535308


Connector Did it publish? Were definitions generated?
connectors/destination-bigquery ✅ ✅

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@airbyteio
Airbyte (airbyteio) temporarily deployed to more-secrets February 9, 2023 13:59 — with GitHub Actions Inactive
@airbyteio
Airbyte (airbyteio) temporarily deployed to more-secrets February 9, 2023 13:59 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Feb 9, 2023

Copy link
Copy Markdown
Contributor

Airbyte Code Coverage

There is no coverage information present for the Files changed

Total Project Coverage 24.66% ❌

@etsybaev

Eugene (etsybaev) commented Feb 9, 2023 •

Copy link
Copy Markdown
Contributor Author

/publish connector=connectors/destination-bigquery-denormalized

🕑 Publishing the following connectors:
connectors/destination-bigquery-denormalized
https://github.com/airbytehq/airbyte/actions/runs/4135148730


Connector Did it publish? Were definitions generated?
connectors/destination-bigquery-denormalized ✅ ✅

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@airbyteio
Airbyte (airbyteio) temporarily deployed to more-secrets February 9, 2023 14:53 — with GitHub Actions Inactive
@airbyteio
Airbyte (airbyteio) temporarily deployed to more-secrets February 9, 2023 14:53 — with GitHub Actions Inactive
@etsybaev
Eugene (etsybaev) enabled auto-merge (squash) February 9, 2023 15:18
@etsybaev
Eugene (etsybaev) temporarily deployed to more-secrets February 9, 2023 16:11 — with GitHub Actions Inactive
@etsybaev
Eugene (etsybaev) temporarily deployed to more-secrets February 9, 2023 16:11 — with GitHub Actions Inactive
@etsybaev
Eugene (etsybaev) merged commit a70d6e8 into master Feb 9, 2023
@etsybaev
Eugene (etsybaev) deleted the etsybaev/22178-destination-bigquery-fixed-table-already-exists-err branch February 9, 2023 16:49

This branch was previously deployed

1 inactive deployment
more-secrets — 51de79cd Deployed Feb 9, 2023 by etsybaev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Destination BigQuery: createTableIfNotExists does not check if table exists prior to creating table

4 participants