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 2021/11/25 19:49:22 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #19821: Sanity check for MySQL's TIMESTAMP column

uranusjr commented on a change in pull request #19821:
URL: https://github.com/apache/airflow/pull/19821#discussion_r757105118



##########
File path: airflow/sensors/base.py
##########
@@ -41,6 +42,13 @@
 # See  https://github.com/apache/airflow/issues/16035
 from airflow.utils.decorators import apply_defaults
 
+# As documented in https://dev.mysql.com/doc/refman/5.7/en/datetime.html.
+_MYSQL_TIMESTAMP_MAX = datetime.datetime(2038, 1, 19, 3, 14, 7, tzinfo=timezone.utc)
+
+
+def _is_metadatabase_mysql() -> bool:
+    return settings.engine and settings.engine.url.get_backend_name() == "mysql"

Review comment:
       Adding cache. It doesn’t seem to worth putting in `settings.py` for me, unless we can find more use cases for the function.




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