Skip to content

Refactor stat helper methods on DagFileProcessorManager#44818

Merged
ashb merged 1 commit intomainfrom
refactor-parser-manger-stats
Dec 10, 2024
Merged

Refactor stat helper methods on DagFileProcessorManager#44818
ashb merged 1 commit intomainfrom
refactor-parser-manger-stats

Conversation

@ashb
Copy link
Member

@ashb ashb commented Dec 10, 2024

This is some cleanup/preporatory work in order to swap the Dag processor over
to use the TaskSDK, and this small change is done to make the future work
easier.

The main bulk of this change is to remote the get_* helper methods and make
_file_stats a defaultdict instead, and then also swap the DagFileStat class
from a NamedTuple (which can't have defaults) to an attrs-defined class which
does.

To make some of the places of use nicer/still one line, the type of
last_duration was changed form a timedelta to a float, as this was what the
get_last_runtime method did, and we don't need any of the capabilities of a
timedelta object elsewhere.

This is some cleanup/preporatory work in order to swap the Dag processor over
to use the TaskSDK, and this small change is done to make the future work
easier.

The main bulk of this change is to remote the `get_*` helper methods and make
`_file_stats` a defaultdict instead, and then also swap the DagFileStat class
from a NamedTuple (which can't have defaults) to an attrs-defined class which
does.

To make some of the places of use nicer/still one line, the type of
last_duration was changed form a timedelta to a float, as this was what the
`get_last_runtime` method did, and we don't need any of the capabilities of a
timedelta object elsewhere.
@boring-cyborg boring-cyborg bot added the area:Scheduler including HA (high availability) scheduler label Dec 10, 2024
@ashb ashb merged commit c291695 into main Dec 10, 2024
@ashb ashb deleted the refactor-parser-manger-stats branch December 10, 2024 17:35
got686-yandex pushed a commit to got686-yandex/airflow that referenced this pull request Jan 30, 2025
This is some cleanup/preporatory work in order to swap the Dag processor over
to use the TaskSDK, and this small change is done to make the future work
easier.

The main bulk of this change is to remote the `get_*` helper methods and make
`_file_stats` a defaultdict instead, and then also swap the DagFileStat class
from a NamedTuple (which can't have defaults) to an attrs-defined class which
does.

To make some of the places of use nicer/still one line, the type of
last_duration was changed form a timedelta to a float, as this was what the
`get_last_runtime` method did, and we don't need any of the capabilities of a
timedelta object elsewhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Scheduler including HA (high availability) scheduler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants