You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/16 19:34:42 UTC

[GitHub] [airflow] jkinkead opened a new issue, #24504: Airflow TypeDecorators are missing cache_ok field

jkinkead opened a new issue, #24504:
URL: https://github.com/apache/airflow/issues/24504

   ### Apache Airflow version
   
   2.2.5
   
   ### What happened
   
   This is a duplicate of #22647 with a clearer title.
   
   Airflow logs warnings when used in combination with SQLAlchemy >= 1.4.14 about missing [`cache_ok` fields](https://docs.sqlalchemy.org/en/14/core/custom_types.html#sqlalchemy.types.TypeDecorator.cache_ok) on the Airflow `TypeDecorator` subclasses.
   
   These look like:
   
   ```
   [2022-03-31, 11:47:06 UTC] {warnings.py:110} WARNING - /home/ec2-user/.local/lib/python3.7/site-packages/airflow/models/renderedtifields.py:163: SAWarning: TypeDecorator UtcDateTime(timezone=True) will not produce a cache key because the ``cache_ok`` attribute is not set 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 type object's state is safe to use in a cache key, or False to disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)
   ```
   
   Airflow may by default use an older version of sqlalchemy where this doesn't happen.
   
   ### What you think should happen instead
   
   Airflow should set these fields so that logs are not emitted.
   
   ### How to reproduce
   
   Loading Airflow models in an environment with SQLAlchemy >= 1.4.14 should show this.
   
   ### Operating System
   
   NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3â­•amazon:amazon_linux:2" HOME_URL="https://amazonlinux.com/"
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==3.0.0
   apache-airflow-providers-celery==2.1.0
   apache-airflow-providers-ftp==2.0.1
   apache-airflow-providers-http==2.0.3
   apache-airflow-providers-imap==2.2.0
   apache-airflow-providers-postgres==3.0.0
   apache-airflow-providers-redis==2.0.1
   apache-airflow-providers-sqlite==2.1.0
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on issue #24504: Airflow TypeDecorators are missing cache_ok field

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #24504:
URL: https://github.com/apache/airflow/issues/24504#issuecomment-1176828805

   closed by #24499  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk closed issue #24504: Airflow TypeDecorators are missing cache_ok field

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #24504: Airflow TypeDecorators are missing cache_ok field
URL: https://github.com/apache/airflow/issues/24504


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org