[AIP-94] Route airflow assets list/details through the API server#68531
Draft
justinpakzad wants to merge 1 commit into
Draft
[AIP-94] Route airflow assets list/details through the API server#68531justinpakzad wants to merge 1 commit into
justinpakzad wants to merge 1 commit into
Conversation
bdd3937 to
e7920cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR migrates the cli
assets listandassets detailscommands to go through the API server (via airflow-ctl client). This is part of the wave of command migrations in the issue linked below. Couple of notes on each command:For
assets listthe original helper functions_list_asset_aliasesand_list_assetswere removed and thedetail_mapperfunction was simplified since the ctl client returns Pydantic models, meaning the mapper function can just call model_dump directly on the objects. Now, depending on the args this command would either map toairflowctl assets listorairflowctl assets list-by-alias. I specified both of the commands in the deprecation warning.For
assets details, if a user provides an asset name or uri, we use the list method and then filter (similar to asset_materialize), if they provide an alias name we call get-by-alias directly. Similar to the list command, bothairflowctl assets get / airflowctl assets get-by-aliascommands were added to the deprecation warning.Tests were modified to use a mock api_client and handle any new cases, following a similar pattern to the reference PR posted in the issue.
I do have a PR open right now which proposes a name change to the
airflowctl list-by-aliascommand, if that gets merged then I will update it with the new command name.related: #68402
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.