Skip to content

Conversation

@henry3260
Copy link
Contributor

Sub task of #56735.
Part of this issue

fixed errors:
image


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.


USE_ROW_LEVEL_LOCKING: bool = conf.getboolean("scheduler", "use_row_level_locking", fallback=True)

T = TypeVar("T", bound=tuple[Any, ...])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a benefit to tuple[Any, ...] over a simple tuple?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Dev-iL, good point. I used tuple[Any, ...] to be more explicit.
It clearly shows it’s a variable-length tuple (...) of any type (Any),
which I find is a bit more precise and readable in the modern syntax.

@henry3260 henry3260 force-pushed the fix-mypy-taskmap branch 3 times, most recently from 7bfbe0c to 77197e2 Compare November 7, 2025 09:04
@henry3260

This comment has been minimized.

@henry3260 henry3260 force-pushed the fix-mypy-taskmap branch 3 times, most recently from 1f50bf8 to 954ad86 Compare November 8, 2025 16:09
@henry3260
Copy link
Contributor Author

Hi @potiuk , it’s ready for merge now. Thanks for reviewing!❤️

:meta private:
"""
locked_rows = with_row_locks(query, session)
select_stmt = cast("Select", query.statement)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why do we need the cast here? (And it’s a bit weird since the query argument is already a Select?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the cast will become obsolete by #55274

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Once #55274 is merged, only Select will remain there—and your mypy will be happy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update! I will wait for your PR to be merged and proceed after that.

locked_rows = with_row_locks(query, session)
select_stmt = cast("Select", query.statement)
locked_statement = with_row_locks(select_stmt, session)
locked_rows = session.execute(locked_statement).all()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to call all() here? It’s quite inefficient especially since we don’t actually use the value.

@vincbeck
Copy link
Contributor

Closing this one because this is being fixed in #58652

@vincbeck vincbeck closed this Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants