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

   ### Apache Airflow version
   
   3.1.5
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When using the HITLOperator, if a DAG param does not have an explicit 
default value, DAG import fails with a ParamValidationError (previously this 
worked). See error in logs: 
   ```
   [2025-12-16 16:44:52] ERROR - Failed to import: 
/opt/airflow/dags/legacy_data_processing/mydag.py
   ParamValidationError: Invalid input for param my_param: No value passed and 
Param has no default value
     File 
"/home/airflow/.local/lib/python3.11/site-packages/airflow/models/dagbag.py", 
line 405 in parse
     File "<frozen importlib._bootstrap_external>", line 940 in exec_module
     File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
     File "/opt/airflow/dags/legacy_data_processing/mydag.py", line 438 in 
<module>
     File 
"/home/airflow/.local/lib/python3.11/site-packages/airflow/sdk/definitions/dag.py",
 line 1557 in factory
     File "/opt/airflow/dags/legacy_data_processing/mydag.py", line 228 in mydag
     File 
"/home/airflow/.local/lib/python3.11/site-packages/airflow/sdk/bases/operator.py",
 line 522 in apply_defaults
     File 
"/home/airflow/.local/lib/python3.11/site-packages/airflow/providers/standard/operators/hitl.py",
 line 101 in __init__
     File 
"/home/airflow/.local/lib/python3.11/site-packages/airflow/providers/standard/operators/hitl.py",
 line 121 in validate_params
     File 
"/home/airflow/.local/lib/python3.11/site-packages/airflow/sdk/definitions/param.py",
 line 242 in validate
   
   ```
   
   ### What you think should happen instead?
   
   Airflow should allow DAGs with params lacking explicit defaults to import, 
as in earlier versions. This validation should not prevent import for 
HITLOperator and similar uses.
   
   ### How to reproduce
   
   1. Create a DAG with a HITLOperator and a param without a default (e.g. 
params={"my_param": Param(type="string")})
   2. Place the DAG in the dags folder for Airflow 3.1.5
   3. Import will fail with ParamValidationError on the missing default value
   4. This does not occur in older Airflow versions
   
   ### Operating System
   
   Debian based, official docker image
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to