Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIP-84: Migrating GET Dataset events for DAG runs api to fastAPI #43874

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

amoghrajesh
Copy link
Contributor

related #42370

Depends on #43783

Migrating the GET Dataset events for DAG runs to fastAPI

Responses:
Legacy
image

FastAPI
image

Swagger spec
image

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 newsfragments.

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Nov 11, 2024
@amoghrajesh
Copy link
Contributor Author

Only the last 3 commits are relevant here

@pierrejeambrun pierrejeambrun added the AIP-84 Modern Rest API label Nov 12, 2024
@pierrejeambrun
Copy link
Member

pierrejeambrun commented Nov 12, 2024

The base branch has been merged, branch needs rebasing.

Also you can add the legacy api tag to allow the CI to build.

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

Nice just a couple of comments.

I'll do a final in depth review when the branch is rebased, it will make the review easier to only have the 'definitive' diff and not also the one from the base branch.

airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated Show resolved Hide resolved
airflow/api_fastapi/core_api/datamodels/assets.py Outdated Show resolved Hide resolved
@amoghrajesh amoghrajesh added the legacy api Whether legacy API changes should be allowed in PR label Nov 13, 2024
@amoghrajesh amoghrajesh self-assigned this Nov 13, 2024
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

Thanks, a few suggestions

airflow/api_fastapi/core_api/datamodels/assets.py Outdated Show resolved Hide resolved
airflow/api_fastapi/core_api/datamodels/assets.py Outdated Show resolved Hide resolved
airflow/api_fastapi/core_api/datamodels/assets.py Outdated Show resolved Hide resolved
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

One small suggestion following the change of convention based on Kaxil's PR that was just merged yesterday.

Otherwise looking good and ready to merge.

Thanks

@amoghrajesh
Copy link
Contributor Author

OK i got a green CI. Is this one good to merge @pierrejeambrun?


class TestGetDagRunAssetTriggerEvents:
def test_should_respond_200(self, test_client, dag_maker, session):
asset1 = Asset(uri="ds1")
Copy link
Collaborator

@rawwar rawwar Nov 14, 2024

Choose a reason for hiding this comment

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

Can we also add a test where there are no assets for an existing dag_id and dag_run_id?

EDIT: probably resolve the comment if that doesn't add any value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rawwar that case would become very similar or same like the case where there is no asset found at all. It is covered here https://github.com/apache/airflow/pull/43874/files#diff-2867320a4cbebd99c9a22b52b509dc2a8920137424ed007ce5a5edfbc78fec60R323-R331

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, It won't raise a 404. Since dag_id and dag_run_id are valid. Should it raise a 404 if no assets are found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AIP-84 Modern Rest API area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. legacy api Whether legacy API changes should be allowed in PR
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants