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

[PR] Accept start_date as string in default_args when start_date is defined in dag constructor. [airflow]

tirkarthi opened a new pull request, #55135:
URL: https://github.com/apache/airflow/pull/55135

   Closes #55134 


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


Re: [PR] Accept start_date as string in default_args when start_date is defined in dag constructor. [airflow]

Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil merged PR #55135:
URL: https://github.com/apache/airflow/pull/55135


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


Re: [PR] Accept start_date as string in default_args when start_date is defined in dag constructor. [airflow]

Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on code in PR #55135:
URL: https://github.com/apache/airflow/pull/55135#discussion_r2313955423


##########
task-sdk/tests/task_sdk/definitions/test_dag.py:
##########
@@ -72,6 +72,9 @@ def test_dag_topological_sort_dag_without_tasks(self):
     def test_dag_naive_start_date_string(self):
         DAG("DAG", schedule=None, default_args={"start_date": "2019-06-01"})
 
+    def test_dag_naive_start_date_constructor_default_args_string(self):
+        DAG("DAG", start_date=DEFAULT_DATE, schedule=None, default_args={"start_date": "2019-06-01"})

Review Comment:
   Thanks, added. I couldn't find this issue when there is no start_date to dag constructor since it seems in that case the `default_args["start_date"]` is parsed as datetime object to be set as the dag.start_date for compatibility.
   
   https://github.com/apache/airflow/blob/dd9981531248625ddf187c71b0705794de7a42c8/task-sdk/src/airflow/sdk/definitions/dag.py#L218-L227



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


Re: [PR] Accept start_date as string in default_args when start_date is defined in dag constructor. [airflow]

Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on code in PR #55135:
URL: https://github.com/apache/airflow/pull/55135#discussion_r2313918532


##########
task-sdk/tests/task_sdk/definitions/test_dag.py:
##########
@@ -72,6 +72,9 @@ def test_dag_topological_sort_dag_without_tasks(self):
     def test_dag_naive_start_date_string(self):
         DAG("DAG", schedule=None, default_args={"start_date": "2019-06-01"})
 
+    def test_dag_naive_start_date_constructor_default_args_string(self):
+        DAG("DAG", start_date=DEFAULT_DATE, schedule=None, default_args={"start_date": "2019-06-01"})

Review Comment:
   Is it worth asserting what the resulting start date actually is here?
   
   In this case, since there are no tasks inside the DAG, I think the start date property on the dag would still be DEFAULT_DATE?



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