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

Refactor Snowflake internal Staging as a base class for other staging classes #10865

Merged
merged 11 commits into from
Mar 11, 2022

Conversation

ChristopheDuong
Copy link
Contributor

@ChristopheDuong ChristopheDuong commented Mar 4, 2022

What

In preparation for other PRs, this one is isolating some changes to make other PRs easier to follow.
Such as: #10866

How

Refactor the Snowflake Internal Staging destination to re-use it as a base for other staging options.

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Nothing is changing. We don't even need to re-publish a snowflake connector.

@github-actions github-actions bot added the area/connectors Connector related issues label Mar 4, 2022
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 4, 2022 20:58 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 4, 2022 20:59 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 8, 2022 13:15 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 8, 2022 13:15 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 8, 2022 13:24 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 8, 2022 13:25 Inactive
@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 8, 2022

/test connector=connectors/destination-snowflake

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

@ChristopheDuong ChristopheDuong marked this pull request as ready for review March 8, 2022 18:38
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.

added a couple comments but I think I mostly understand

@@ -45,4 +47,8 @@
@Deprecated
String getTmpTableName(String name);

String getStageName(String schemaName, String tableName);

String getStagingPath(String connectionId, String schemaName, String tableName, DateTime writeDatetime);
Copy link
Contributor

Choose a reason for hiding this comment

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

These methods do not look necessary for all destination. Should they be put in this interface?

Copy link
Contributor Author

@ChristopheDuong ChristopheDuong Mar 10, 2022

Choose a reason for hiding this comment

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

Correct! thank you, I'll move them to stagingOperations

@ChristopheDuong ChristopheDuong changed the title Refactor Snowflake internal Staging Refactor Snowflake internal Staging as a base class for other staging classes Mar 10, 2022
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ChristopheDuong
❌ Chris Duong


Chris Duong seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 10, 2022 12:58 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 10, 2022 12:58 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 10, 2022 13:02 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 10, 2022 13:02 Inactive
@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

❗ No coverage uploaded for pull request base (master@1bf9470). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #10865   +/-   ##
=========================================
  Coverage          ?   78.06%           
=========================================
  Files             ?       12           
  Lines             ?     1304           
  Branches          ?        0           
=========================================
  Hits              ?     1018           
  Misses            ?      286           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bf9470...2a923e7. Read the comment docs.

@github-actions github-actions bot added the area/platform issues related to the platform label Mar 10, 2022
@github-actions github-actions bot added the area/worker Related to worker label Mar 10, 2022
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 10, 2022 16:25 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 10, 2022 16:25 Inactive
@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 10, 2022

/test connector=connectors/destination-snowflake

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

Name                                                                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                                                                                          2      0   100%
normalization/transform_catalog/reserved_keywords.py                                                                               13      0   100%
normalization/transform_catalog/__init__.py                                                                                         2      0   100%
normalization/destination_type.py                                                                                                  13      0   100%
normalization/__init__.py                                                                                                           4      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py     124      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/__init__.py               1      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/__init__.py                      2      0   100%
normalization/transform_catalog/destination_name_transformer.py                                                                   155      8    95%
normalization/transform_catalog/table_name_registry.py                                                                            174     34    80%
normalization/transform_config/transform.py                                                                                       150     30    80%
normalization/transform_catalog/utils.py                                                                                           33      7    79%
normalization/transform_catalog/catalog_processor.py                                                                              143     77    46%
normalization/transform_catalog/transform.py                                                                                       45     26    42%
normalization/transform_catalog/stream_processor.py                                                                               524    337    36%
---------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                            1385    519    63%

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.

one last comment, feel free to merge if I'm misunderstanding how the class works

@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 11, 2022 12:15 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 11, 2022 12:15 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 11, 2022 13:24 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 11, 2022 13:25 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 11, 2022 13:43 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets March 11, 2022 13:43 Inactive
@ChristopheDuong ChristopheDuong merged commit 744e0d5 into master Mar 11, 2022
@ChristopheDuong ChristopheDuong deleted the chris/refactor-internal-staging branch March 11, 2022 14:29
terencecho pushed a commit that referenced this pull request Mar 14, 2022
… classes (#10865)

* Refactor Snowflake internal Staging as model to share staging abilities in jdbc destinations
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/platform issues related to the platform area/worker Related to worker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants