This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 60eccf0fca Revert the Python 3.11 exclusion for date isoformat (#32490)
60eccf0fca is described below

commit 60eccf0fca2ccc0e746f1cd6225ba6e8ef896b05
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Jul 10 15:00:31 2023 +0200

    Revert the Python 3.11 exclusion for date isoformat (#32490)
    
    The official Python image for 3.11 had a brief period when the
    date `20120503` has been an acceptable date, but it is not
    accepted as of 3.11.4 release on 5th of July.
    
    This PR reverts  the changes in tests implemented in #27264 to
    accomodate for it and brings back the date as error case.
---
 tests/models/test_param.py | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/tests/models/test_param.py b/tests/models/test_param.py
index 64932213df..4053cf6571 100644
--- a/tests/models/test_param.py
+++ b/tests/models/test_param.py
@@ -20,7 +20,6 @@ from contextlib import nullcontext
 
 import pytest
 
-from airflow import PY311
 from airflow.decorators import task
 from airflow.exceptions import ParamValidationError, RemovedInAirflow3Warning
 from airflow.models.param import Param, ParamsDict
@@ -127,25 +126,20 @@ class TestParam:
         "date_string",
         [
             "2021-01-01",
-            pytest.param(
-                "20120503",
-                marks=pytest.mark.skipif(not PY311, reason="Improved 
fromisoformat() in 3.11."),
-            ),
         ],
     )
     def test_string_date_format(self, date_string):
         """Test string date format."""
         assert Param(date_string, type="string", format="date").resolve() == 
date_string
 
+    # Note that 20120503 behaved differently in 3.11.3 Official python image. 
It was validated as a date
+    # there but it started to fail again in 3.11.4 released on 2023-07-05.
     @pytest.mark.parametrize(
         "date_string",
         [
             "01/01/2021",
             "21 May 1975",
-            pytest.param(
-                "20120503",
-                marks=pytest.mark.skipif(PY311, reason="Improved 
fromisoformat() in 3.11."),
-            ),
+            "20120503",
         ],
     )
     def test_string_date_format_error(self, date_string):

Reply via email to