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

build(ingest): upgrade to sqlalchemy 1.4, drop 1.3 support #8810

Conversation

mayurinehate
Copy link
Collaborator

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added ingestion PR or Issue related to the ingestion of metadata docs Issues and Improvements to docs labels Sep 8, 2023
@@ -451,17 +451,10 @@ def _get_operation_aspect_work_unit(
yield wu

def _process_snowflake_history_row(
self, row: Any
self, event_dict: dict
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We use DictCursor in snowflake, so this is always a dictionary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

@mayurinehate mayurinehate marked this pull request as ready for review September 8, 2023 11:39
docs/how/updating-datahub.md Outdated Show resolved Hide resolved
@@ -112,7 +112,7 @@ def get_long_description():

sql_common = {
# Required for all SQL sources.
"sqlalchemy>=1.3.24, <2",
"sqlalchemy>=1.4.0, <2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we actually support 1.4.0? We probably want a stronger lower bound

Suggested change
"sqlalchemy>=1.4.0, <2",
"sqlalchemy>=1.4.0, <2",

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I noticed lint failure in ./tests/test_helpers/sqlalchemy_mypy_plugin.py when using sqlalchemy==1.4.0. Upgrading to 1.4.8 lower bound solves this. Do you have any thoughts on how to decide stronger lower bound - maybe based on recency OR quickly try out some sqlalchemy versions in test matrix and choosing the least which works .

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suspect our true lower bound is higher than 1.4.8, but I don't think it's worth the effort of finding it just yet

For now, let's set the lower bound to something that's a year or so old (maybe 1.4.39 from Jun 2022) and add a comment explaining that it's a temporary lower bound that we're open to loosening/tightening as requirements show up

main compat issues I anticipate are gonna be from GE, so let's see how it goes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated lower bound to 1.4.39 and added comment in this commit.

@@ -451,17 +451,10 @@ def _get_operation_aspect_work_unit(
yield wu

def _process_snowflake_history_row(
self, row: Any
self, event_dict: dict
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

@hsheth2 hsheth2 added merge-pending-ci A PR that has passed review and should be merged once CI is green. and removed merge-pending-ci A PR that has passed review and should be merged once CI is green. labels Sep 11, 2023
Updated SQLAlchemy lower bound to 1.4.8 to avoid the error `cannot import name 'Optional' from 'mypy.plugin'` in `./tests/test_helpers/sqlalchemy_mypy_plugin.py`
@hsheth2 hsheth2 added the merge-pending-ci A PR that has passed review and should be merged once CI is green. label Sep 12, 2023
@hsheth2 hsheth2 merged commit 303a2d0 into datahub-project:master Sep 12, 2023
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues and Improvements to docs ingestion PR or Issue related to the ingestion of metadata merge-pending-ci A PR that has passed review and should be merged once CI is green.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants