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

fix(ingest/snowflake): Fixing table rename query handling #12852

Merged
merged 3 commits into from
Mar 13, 2025

Conversation

skrydal
Copy link
Collaborator

@skrydal skrydal commented Mar 12, 2025

For table renames operationType in object_modified_by_ddl dictionary is ALTER. We need to check query_type to see whether it was table-rename-kind-of-alter. Taking this into consideration I added this value to parse_ddl_query. Considering pre-existing logic there I had to swap order of if conditions to achieve intended behavior (the logic didn't change beyond that).

@skrydal skrydal requested a review from mayurinehate March 12, 2025 12:43
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Mar 12, 2025
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Mar 12, 2025
Copy link
Collaborator

@hsheth2 hsheth2 left a comment

Choose a reason for hiding this comment

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

Seems pretty reasonable - would be good to add some unit tests for the parse_ddl_query (basically just with a given object_modified_by_ddl value, make sure it generates the right operation)

@datahub-cyborg datahub-cyborg bot added pending-submitter-merge and removed needs-review Label for PRs that need review from a maintainer. labels Mar 12, 2025
query=query,
session_id=session_id,
timestamp=timestamp,
), "Processing ALTER ... RENAME should result in a proper TableRename object"
Copy link
Collaborator

Choose a reason for hiding this comment

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

in general, we don't need comments on asserts - the test feels pretty clear already

@skrydal skrydal merged commit ba8932c into datahub-project:master Mar 13, 2025
77 checks passed
@skrydal skrydal deleted the fix_snowflake_table_rename branch March 13, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata pending-submitter-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants