Skip to content

Custom timetable generate_run_id function no longer used for manually triggered dag runs #55908

@NilsJPWerner

Description

@NilsJPWerner

Apache Airflow version

3.0.6

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

No response

What happened?

In airflow 2.X the generate_run_id method of a custom timetable was used for both scheduled and manually triggered dags. In airflow 3 custom generate_run_id is still used for scheduled dag runs but is not used for manual triggers

Before:

    run_id = run_id or dag.timetable.generate_run_id(
        run_type=DagRunType.MANUAL, logical_date=logical_date, data_interval=data_interval
    )

After

    run_id = run_id or DagRun.generate_run_id(
        run_type=DagRunType.MANUAL,
        logical_date=coerced_logical_date,
        run_after=timezone.coerce_datetime(run_after),
    )

035060d#diff-98bce8c9085a1f92608314c673762bddd0031441b3d1fd933f2deaeb3fcee132

cc @sunank200 @uranusjr

What you think should happen instead?

No response

How to reproduce

Use this timetable and trigger a dag with it

class CustomTimetable(CronDataIntervalTimetable):
    def generate_run_id(
        self,
        *,
        data_interval: DataInterval,
        **kwargs,
    ) -> str:
        return data_interval.start.strftime("%Y%m%d%H%M%S")

Operating System

Debian

Versions of Apache Airflow Providers

No response

Deployment

Astronomer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions