You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/02/06 23:25:21 UTC

[GitHub] [airflow] potiuk commented on pull request #29395: Fix validation of date-time field in API and Parameter schemas

potiuk commented on PR #29395:
URL: https://github.com/apache/airflow/pull/29395#issuecomment-1419931607

   I think this is the only way to proceed even though it introduces potential backwards-compatibility for those for whom the validation accidentally worked before:
   
   Example snipppet of code showing how `date-time` fields will be validated after installing the validator:
   
   ```
   >>> from airflow.utils.timezone import datetime
   >>> from rfc3339_validator import validate_rfc3339
   >>> dtt =  datetime(2020, 1, 1)
   >>> print(dtt)
   2020-01-01 00:00:00+00:00
   >>> validate_rfc3339(str(dtt))
   False
   >>> validate_rfc3339('2020-01-01T00:00:00+00:00')
   True
   >>> validate_rfc3339('2020-01-01T00:00:00')
   False
   ```
   


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