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/19 20:54:48 UTC

[GitHub] [airflow] uranusjr commented on issue #19716: [Airflow 2.2.2] execution_date Proxy object - str formatting error

uranusjr commented on issue #19716:
URL: https://github.com/apache/airflow/issues/19716#issuecomment-974465572


   This can be worked around by implementing a proxy specific for datetime:
   
   ```pycon
   >>> from lazy_object_proxy import Proxy
   >>> class DTProxy(Proxy):
   ...  def __format__(self, spec):
   ...   return self.__wrapped__.__format__(spec)
   ...
   >>> from airflow.utils.timezone import utcnow
   >>> p = DTProxy(utcnow)
   >>> f"{p:%Y-%m-%d}"
   '2021-11-19'
   ```


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