vatsrahul1001 opened a new issue, #44473:
URL: https://github.com/apache/airflow/issues/44473

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   During AIP-65 testing, we observed that using dynamic dates in DAG 
parameters leads to the continuous creation of multiple DAG versions. This 
behavior can cause clutter dag_version table.
   
   
   
   ### What you think should happen instead?
   
   Ideally, dynamic dates should not be used in DAG parameters. To address 
this, we can add a Ruff rule to identify and prevent the use of dynamic dates 
in DAG params, ensuring better practices and avoiding unnecessary version 
proliferation.
   
   ### How to reproduce
   
   1. Use the below DAG.
   
   ```
   from airflow.decorators import dag, task
   from datetime import datetime, timedelta
   import pendulum
   from airflow.models.param import Param
   
   default_args = {
       "owner": "airflow",
   
       "retries": 1,
       "retry_delay": timedelta(minutes=1),
   }
   
   @dag(description="Create and read a file", schedule='@daily', catchup=False, 
tags=['Atul_Practice11'], start_date=datetime(2024, 1, 
1),default_args=default_args,  params={
           "clean_before_timestamp": Param(
               default=(datetime.now(tz=pendulum.UTC) - 
timedelta(days=90)).isoformat(),
               type="string",
               format="date-time",
               description="Delete records older than this timestamp. Default 
is 90 days ago.",
           )})
   def check_dag_retry():
   
       @task
       def read_file():
           pass
       read_file()
   check_dag_retry()
   ```
   2. Check DAG Version table 
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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-unsubscr...@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to