Skip to content

Resolve deprecation warning re Table.exists()#26616

Merged
jedcunningham merged 3 commits into
apache:mainfrom
astronomer:fix-has_table-warning
Sep 23, 2022
Merged

Resolve deprecation warning re Table.exists()#26616
jedcunningham merged 3 commits into
apache:mainfrom
astronomer:fix-has_table-warning

Conversation

@dstandish

Copy link
Copy Markdown
Contributor

The deprecation warning tells us we need to change Table.exists() to Inspector.has_table(). It turns out we're already using the right method, but we weren't passing it the right object. It wants a table name but we were giving it a table.

@uranusjr do you think it's safe to remove the compat layer altogether?

image

@dstandish
dstandish requested a review from uranusjr September 23, 2022 06:04
@uranusjr

Copy link
Copy Markdown
Member

I think so, we are now requiring sqlalchemy>=1.4, which should always contain the new functions.

@uranusjr uranusjr added this to the Airflow 2.4.1 milestone Sep 23, 2022
@uranusjr

Copy link
Copy Markdown
Member

Need to fix compat shim usages in migration files

The deprecation warning tells us we need to change Table.exists() to Inspector.has_table().  It turns out we're already using the right method, but we weren't passing it the right object.  It wants a table name but we were giving it a table.
@jedcunningham
jedcunningham merged commit 2388bd7 into apache:main Sep 23, 2022
@jedcunningham
jedcunningham deleted the fix-has_table-warning branch September 23, 2022 20:30
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Sep 23, 2022
jedcunningham pushed a commit that referenced this pull request Sep 27, 2022
The deprecation warning tells us we need to change Table.exists() to Inspector.has_table().  It turns out we're already using the right method, but we weren't passing it the right object.  It wants a table name but we were giving it a table.

(cherry picked from commit 2388bd7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants