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

Add inherit_cache attribute for CreateTableAs custom SA Clause #38985

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

Taragolis
Copy link
Contributor

We should set cache_ok or inherit_cache explicitly for custom clauses or types. See (valid for 1.4 and 2.0): https://docs.sqlalchemy.org/en/20/errors.html#assertion-attributes-for-caching

{
    "category": "sqlalchemy.exc.SAWarning",
    "message": "Class CreateTableAs will not make use of SQL compilation caching as it does not set the 'inherit_cache' attribute to ``True``.  This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions.  Set this attribute to True if this object can make use of the cache key generated by the superclass.  Alternatively, this attribute may be set to False which will disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)",
    "node_id": "tests/utils/test_db_cleanup.py::TestDBCleanup::test__build_query",
    "filename": "tests/utils/test_db_cleanup.py",
    "lineno": 216,
    "group": "tests",
    "count": 1,
    "source": "test-warnings-DB-Postgres-postgres-12-3.8/warnings-core-postgres.txt"
}

^ 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.

@Taragolis Taragolis added type:bug-fix Changelog: Bug Fixes full tests needed We need to run full set of tests for this PR to merge labels Apr 13, 2024
@Taragolis Taragolis added this to the Airflow 2.9.1 milestone Apr 13, 2024
@potiuk potiuk merged commit bdb8f74 into apache:main Apr 14, 2024
68 of 69 checks passed
utkarsharma2 pushed a commit to astronomer/airflow that referenced this pull request Apr 22, 2024
jedcunningham pushed a commit that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full tests needed We need to run full set of tests for this PR to merge type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants