smirkybg commented on issue #55889: URL: https://github.com/apache/airflow/issues/55889#issuecomment-3479968958
Hello! I came across this task when searching how to suppress these deprecation warnings. I'm using Apache Airflow in Docker and I'm getting these: ```/home/airflow/.local/lib/python3.10/site-packages/airflow/providers/cncf/kubernetes/utils/pod_manager.py:45 DeprecatedImportWarning: The `airflow.utils.timezone.utcnow` attribute is deprecated. Please use `'airflow.sdk.timezone.utcnow'`.``` Since this is not coming from code I wrote and it's coming from Apache Airflow, I thought that it would be nice if I can suppress it. Turns out I can't, because this is a custom warning and not a standard one. For example, if I use these ignore rules, they don't suppress it: `export PYTHONWARNINGS="ignore::DeprecationWarning,ignore::ImportWarning"` If I add `DeprecatedImportWarning` to the list, I get this: `Invalid -W option ignored: invalid module name: 'airflow.utils.context'` which lead me to the conclusion it's not a standard warning. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
