Skip to content

Conversation

@feluelle
Copy link
Member

In PostgresHook the "schema" field is only being called like that to make it compatible with the underlying DbApiHook which uses the schema for the sql alchemy connector. The postgres connector library however does not allow setting a schema in the connection instead a database can be set. To clarify that, we change all references in the PostgresHook code and documentation.


^ 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 PostgresHook the "schema" field is only being called like that to make it compatible with the underlying DbApiHook which uses the schema for the sql alchemy connector. The postgres connector library however does not allow setting a schema in the connection instead a database can be set. To clarify that, we change all references in the PostgresHook code and documentation.
@feluelle feluelle requested a review from kaxil September 16, 2022 14:52
- use deprecation warning instead of log.error
- clarify docs about database & schema
@feluelle feluelle requested a review from kaxil September 19, 2022 09:55
Copy link
Member Author

@feluelle feluelle left a comment

Choose a reason for hiding this comment

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

I added backwards compatibility. Please review again @kaxil. 🙏

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

LGTM. WDYT @kaxil ?

@kaxil kaxil merged commit 642375f into apache:main Sep 27, 2022
jedcunningham added a commit to astronomer/airflow that referenced this pull request Sep 27, 2022
jedcunningham added a commit that referenced this pull request Sep 27, 2022
This reverts commit 642375f.

The common sql tests didn't run in #26436, and there are failures there from this change.

I think they might point toward compatibility problems with the change, so reverting for now.
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.

5 participants