Skip to content

Conversation

@ashb
Copy link
Member

@ashb ashb commented Apr 7, 2025

Unfortunately since we have forbid extra in the generated client this resulted
in old clients failing to work with new servers, one of the things we are
deliberately using Cadwyn to avoid.

And it does help, when we remember/know to use it.

This fixes this specific case, and I've created #48887 to catch it in CI
long-term.


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

…nts`

Unfortunately since we have forbid extra in the generated client this resulted
in old clients failing to work with new servers, one of the things we are
deliberately using Cadwyn to avoid.

And it does help, when we remember/know to use it.

This fixes this specific case, and I've created apache#48887 to catch it in CI
long-term.
@ashb ashb requested review from amoghrajesh and kaxil as code owners April 7, 2025 17:05
@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:task-sdk labels Apr 7, 2025
@ashb ashb added affected_version:3.0.0rc kind:bug This is a clearly a bug labels Apr 7, 2025
@ashb ashb merged commit 3b5e4bb into apache:main Apr 7, 2025
99 checks passed
@ashb ashb deleted the consumed_asset_events-api-compat branch April 7, 2025 18:08
ashb added a commit to astronomer/airflow that referenced this pull request Apr 7, 2025
… change

This is a similar sort of change to apache#48888, but in that case the fix is API
versioning, here we can't make use of that approach as the the TI isn't sent
over the API  -- it's sent via the Executor to the worker.

So for now the best approach we have here is to allow extra, and be careful
when adding new fields to make sure it is version compatible.

This will need special handling in apache#48887 too.
ashb added a commit that referenced this pull request Apr 7, 2025
… change (#48894)

This is a similar sort of change to #48888, but in that case the fix is API
versioning, here we can't make use of that approach as the the TI isn't sent
over the API  -- it's sent via the Executor to the worker.

So for now the best approach we have here is to allow extra, and be careful
when adding new fields to make sure it is version compatible.

This will need special handling in #48887 too.
simonprydden pushed a commit to simonprydden/airflow that referenced this pull request Apr 8, 2025
simonprydden pushed a commit to simonprydden/airflow that referenced this pull request Apr 8, 2025
… change (apache#48894)

This is a similar sort of change to apache#48888, but in that case the fix is API
versioning, here we can't make use of that approach as the the TI isn't sent
over the API  -- it's sent via the Executor to the worker.

So for now the best approach we have here is to allow extra, and be careful
when adding new fields to make sure it is version compatible.

This will need special handling in apache#48887 too.
ashb added a commit to astronomer/airflow that referenced this pull request Apr 8, 2025
And, like I should have done in apache#48888, add tests this time.

The issue was caused by me misunderstanding how Cadwyn works, the
`instructions_to_migrate_to_previous_version` only affect the OpenAPI schema,
but since the change in this case results in an "invalid" model being
returned, we have to write our own migration for the data.

For those curious, the error without this migration function is:

> fastapi.exceptions.ResponseValidationError: 1 validation errors:
>  {'type': 'extra_forbidden', 'loc': ('response', 'dag_run', 'consumed_asset_events'), 'msg': 'Extra inputs are not permitted', 'input': []}
ashb added a commit that referenced this pull request Apr 8, 2025
And, like I should have done in #48888, add tests this time.

The issue was caused by me misunderstanding how Cadwyn works, the
`instructions_to_migrate_to_previous_version` only affect the OpenAPI schema,
but since the change in this case results in an "invalid" model being
returned, we have to write our own migration for the data.

For those curious, the error without this migration function is:

> fastapi.exceptions.ResponseValidationError: 1 validation errors:
>  {'type': 'extra_forbidden', 'loc': ('response', 'dag_run', 'consumed_asset_events'), 'msg': 'Extra inputs are not permitted', 'input': []}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:task-sdk kind:bug This is a clearly a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants