sejal-gupta-ksolves opened a new pull request, #67636:
URL: https://github.com/apache/airflow/pull/67636
* closes: #66492
---
### Description
When triggering a DAG with a `Param` configured with `format='time'`, the
frontend UI time field can emit hours and minutes (`HH:MM`) depending on
browser implementation. However, the backend validation uses
`jsonschema.FormatChecker`, which strictly expects a full `HH:MM:SS` format
parsed via `datetime.strptime(instance, "%H:%M:%S")`. This mismatch causes the
UI to fail immediately with a `400 Bad Request` validation error upon form
submission.
This PR resolves the issue directly within the `FieldDateTime` component
input pipeline:
#### Changes:
1. **HTML Picker Attribute**: Enabled `step="1"` conditionally on the native
time picker element so that compliant rendering engines naturally expose the
seconds selection column.
2. **Value Normalization Pipeline**: Added a `normalizeTime` helper inside
`handleChange`. If a browser emits an `HH:MM` pattern string, it automatically
formats it to `HH:MM:SS` by appending `:00` prior to updating the param state
dictionary and triggering `onUpdate`.
3. **Comprehensive Test Validation**: Introduced an isolated, high-coverage
unit testing suit (`FieldDateTime.test.tsx`) addressing:
- Injecting missing seconds padding (`15:58` -> `15:58:00`).
- Retaining fully structured values unmodified (`15:58:42` -> `15:58:42`).
- Null parameter fallbacks when erasing values.
- Leak protection verifying that standard date inputs are left un-mutated.
- Missing dictionary key edge cases to prevent errors if the target
parameter context hasn't loaded yet.
---
--
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]