apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
36.4k stars 14.11k forks source link

Datetime params missing microseconds in Trigger DAG menu #40932

Open Nick-Nal opened 2 months ago

Nick-Nal commented 2 months ago

Apache Airflow version

2.9.3

If "Other Airflow 2 version" selected, which one?

No response

What happened?

Greetings I've stumbled upon a problem and inconsistency with datetime-typed DAG params

Let's take a DAG with datetime param that has a default value matching end of some day - 23:59:59.999999

"metrics_end_time": Param(
                default = pendulum.now(tz = "UTC").first_of("quarter").end_of("day").subtract(days = 1).isoformat(),
                type = "string",
                format = 'date-time',
                title = "metrics_end_time",
                description = "Upper bound for general metrics calculation time period"
                )

It works just as expected for any scheduled runs, all fractions of the second passed correctly

But if I want to trigger that same DAG manually from UI there's no way to launch it with preserving fractional part image

Firstly, this param showing up in UI without any fractional part at all Secondly, even if fractional part will be typed in this field (as '2024-07-22T23:59:59.999999+00:00', for example) - value won't be saved, DAG will start with allballs in fractional part

I'm understanding all workarounds, but it looks like an incosistency that shoud be fixed

What you think should happen instead?

No response

How to reproduce

Try to manually run from UI any DAG with datetime param with fractional part in seconds - the fractional part will be missed

Operating System

Ubuntu 22.04

Versions of Apache Airflow Providers

No response

Deployment

Virtualenv installation

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

Code of Conduct

boring-cyborg[bot] commented 2 months ago

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

uranusjr commented 1 month ago

I’d prefer implementing #9237 and adding an inclusive/exclusive toggle to the time fields. That’s more intuitive than adding .99999 to the time IMO.