Skip to content

Conversation

@Taragolis
Copy link
Contributor

Follow-up: #35727, #35752

Remove inheritance from backcompat classes and fix static checks


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

"""


# In case we are running it on Airflow 2.4+, we should use BaseHook, but on Airflow 2.3 and below
Copy link
Member

Choose a reason for hiding this comment

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

That was a mighty hack !

if "jwt__file" in extra:
with open(extra.get("jwt__file")) as jwt_file:
token = jwt_file.read()
if not exactly_one(jwt_file := "jwt__file" in extra, jwt_token := "jwt__token" in extra):
Copy link
Member

Choose a reason for hiding this comment

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

Any particular reason we have those changes ? They look unrelated to 2.4 compatibility removal. Should we separate it out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They look unrelated to 2.4 compatibility removal.

After change inheritance this block of code do not pass static checks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was the way to fix it by different way, however I preferred to add additional validation

Copy link
Member

Choose a reason for hiding this comment

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

I see. No problem then.

@Taragolis Taragolis merged commit 2a469b3 into apache:main Nov 21, 2023
@Taragolis Taragolis deleted the sql-common-remove-backcompat branch November 21, 2023 07:12
ephraimbuddy pushed a commit that referenced this pull request Nov 23, 2023
* Remove backcompat inheritance for DbApiHook

* jwt_file > jwt__file

* simplify trino test
ephraimbuddy pushed a commit that referenced this pull request Nov 26, 2023
* Remove backcompat inheritance for DbApiHook

* jwt_file > jwt__file

* simplify trino test
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.

4 participants