Skip to content

Conversation

@uranusjr
Copy link
Member

@uranusjr uranusjr commented Mar 7, 2025

Asset evaluation is only done in the scheduler, and requires the database in various cases. It is better to split it out into a dedicated class in Airflow core.

Close #47378
Fix #47483

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

That was quick, thanks!

@uranusjr
Copy link
Member Author

uranusjr commented Mar 7, 2025

I added an additional commit to remove db calls in iter_dag_dependencies as well. This is called during DAG serialization. The result is stored in the SerializedDag and sent to the UI later. Removing the calls makes the UI not quite right, but @Lee-W is already working on changing the API around this.

uranusjr added 2 commits March 7, 2025 18:53
Asset evaluation is only done in the scheduler, and requires the
database in various cases. It is better to split it out into a dedicated
class in Airflow core.
Dependency resolution requires database calls for non-direct asset
references, but we don't want that to happen in the SDK. This removes
the eager resolution code so all asset aliases and refs are no longer
resolved, but one only keeps a marker for itself.

An additional PR will be submitted later to do the resolution. This is a
part of the asset UI project that involves changes in the API anyway.
@uranusjr uranusjr force-pushed the move-asset-evaluate-to-scheduler branch from e44a50c to d9acd62 Compare March 7, 2025 10:53
@uranusjr uranusjr merged commit cd78078 into apache:main Mar 7, 2025
62 checks passed
@uranusjr uranusjr deleted the move-asset-evaluate-to-scheduler branch March 7, 2025 11:47
nailo2c pushed a commit to nailo2c/airflow that referenced this pull request Apr 4, 2025
Asset evaluation is only done in the scheduler, and requires the
database in various cases. It is better to split it out into a dedicated
class in Airflow core.

Dependency resolution requires database calls for non-direct asset
references, but we don't want that to happen in the SDK. This removes
the eager resolution code so all asset aliases and refs are no longer
resolved, but one only keeps a marker for itself.

An additional PR will be submitted later to do the resolution. This is a
part of the asset UI project that involves changes in the API anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

asset alias example dag is failing with Direct database access via the ORM is not allowed in Airflow 3.0 Pull scheduler logic out of asset classes

3 participants