pankajkoti commented on code in PR #37473: URL: https://github.com/apache/airflow/pull/37473#discussion_r1492188899
########## pyproject.toml: ########## @@ -1468,6 +1468,9 @@ banned-module-level-imports = ["numpy", "pandas"] "airflow.AirflowException".msg = "Use airflow.exceptions.AirflowException instead." "airflow.Dataset".msg = "Use airflow.datasets.Dataset instead." "airflow.models.baseoperator.BaseOperatorLink".msg = "Use airflow.models.baseoperatorlink.BaseOperatorLink" +# Deprecated in Python 3.12: https://github.com/python/cpython/issues/103857 +"datetime.datetime.utcnow".msg = "Use airflow.utils.timezone.utcnow or datetime.datetime.utc(tz=...)" +"datetime.datetime.utcfromtimestamp".msg = "Use airflow.utils.timezone.from_timestamp or datetime.datetime.fromtimestamp(tz=...)" Review Comment: ```suggestion "datetime.datetime.utcfromtimestamp".msg = "Use airflow.utils.timezone.from_timestamp or datetime.datetime.fromtimestamp(tz=datetime.timezone.utc)" ``` ########## pyproject.toml: ########## @@ -1468,6 +1468,9 @@ banned-module-level-imports = ["numpy", "pandas"] "airflow.AirflowException".msg = "Use airflow.exceptions.AirflowException instead." "airflow.Dataset".msg = "Use airflow.datasets.Dataset instead." "airflow.models.baseoperator.BaseOperatorLink".msg = "Use airflow.models.baseoperatorlink.BaseOperatorLink" +# Deprecated in Python 3.12: https://github.com/python/cpython/issues/103857 +"datetime.datetime.utcnow".msg = "Use airflow.utils.timezone.utcnow or datetime.datetime.utc(tz=...)" Review Comment: ```suggestion "datetime.datetime.utcnow".msg = "Use airflow.utils.timezone.utcnow or datetime.datetime.now(tz=datetime.timezone.utc)" ``` ########## pyproject.toml: ########## @@ -1468,6 +1468,9 @@ banned-module-level-imports = ["numpy", "pandas"] "airflow.AirflowException".msg = "Use airflow.exceptions.AirflowException instead." "airflow.Dataset".msg = "Use airflow.datasets.Dataset instead." "airflow.models.baseoperator.BaseOperatorLink".msg = "Use airflow.models.baseoperatorlink.BaseOperatorLink" +# Deprecated in Python 3.12: https://github.com/python/cpython/issues/103857 +"datetime.datetime.utcnow".msg = "Use airflow.utils.timezone.utcnow or datetime.datetime.utc(tz=...)" Review Comment: I think would make sense to explicitly provide the replacement value for `utcnow` with `tz=datetime.timezone.utc` than `...` -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org