pedro-cf opened a new issue, #75747:
URL: https://github.com/apache/airflow/issues/75747
### Under which category would you file this issue?
Airflow Core
### Apache Airflow version
3.3.1
### What happened and how to reproduce it?
When a DAG Param sets a minimum or maximum on an integer field, typing a
value outside that range in the Airflow 3 Trigger form does not fail the
trigger. The form quietly changes the number to fit the allowed range, then
submits it. The run starts with the corrected value instead of being blocked.
Example DAG:
```
from airflow.sdk import Param, dag, task
@dag(
dag_id="repro_param_minmax_clamp",
schedule=None,
start_date=None,
catchup=False,
params={
"hold_seconds": Param(180, type="integer", minimum=1, maximum=600),
},
)
def repro():
@task
def show(params=None):
print((params or {}).get("hold_seconds"))
show()
repro()
```
### How to reproduce
1. Deploy the DAG above on Airflow 3.3.1 (also present on current `main`
`FieldNumber.tsx`: `max={param.schema.maximum}`, `min={param.schema.minimum}`).
2. Open Trigger DAG in the UI.
3. Type `6666` in `hold_seconds` (above `maximum=600`).
4. Trigger the DAG.
5. Observe: the field/value becomes `600` (or similar clamp), the run starts
successfully, and the task prints `600`.
6. Repeat with `0` or `-5` (below `minimum=1`): the UI clamps up to `1`
instead of blocking the trigger.
Contrast: CLI/API correctly reject the same values:
```
airflow dags trigger repro_param_minmax_clamp --conf '{"hold_seconds": 6666}'
# ParamValidationError: 6666 is greater than the maximum of 600
airflow dags trigger repro_param_minmax_clamp --conf '{"hold_seconds": 0}'
# ParamValidationError: 0 is less than the minimum of 1
```
Docs say invalid params should show a warning and not create a DagRun. The
UI path never sends the invalid value, so that validation never runs.
### What you think should happen instead?
1. User can type a value outside `[minimum, maximum]` (or the field keeps
the invalid typed value).
2. On Trigger, the UI/API fails validation (inline or form error), same as
CLI/API `ParamValidationError`.
3. No DagRun is created until the value is corrected.
Suggested direction: do not pass schema `min`/`max` into `NumberInput` as
hard clamps (or disable clamp behavior), and rely on Param JSON Schema
validation at submit time for both min and max, consistent with the documented
trigger behavior and with the backend.
### Operating System
Ubuntu 24.04.4 LTS
### Deployment
Docker-Compose
### Apache Airflow Provider(s)
_No response_
### Versions of Apache Airflow Providers
_No response_
### Official Helm Chart version
_No response_
### Kubernetes Version
_No response_
### Helm Chart configuration
_No response_
### Docker Image customizations
_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]