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

REST API: Fix wrong plugin schema #34858

Merged
merged 4 commits into from
Oct 12, 2023
Merged

Conversation

ephraimbuddy
Copy link
Contributor

We serialize some plugin's fields as dictionaries leading to errors when accessing the /plugins endpoint.

Here's the error:
ValueError: dictionary update sequence element #0 has length 1; 2 is required

The fields are lists of strings and this PR addresses it.

We serialize some plugin's fields as dictionaries leading to errors
when accessing the `/plugins` endpoint.

Here's the error:
ValueError: dictionary update sequence element #0 has length 1; 2 is required

The fields are lists of strings and this PR addresses it.
@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Oct 11, 2023
@ephraimbuddy
Copy link
Contributor Author

I'm not sure how we can test this. Create a Plugin?

@uranusjr
Copy link
Member

We already have tests to test the endpoint, but those fields are all empty in the stub plugin so it does not reflect the change. Maybe it would be possible to add those to the test.

https://github.com/apache/airflow/blob/main/tests/api_connexion/endpoints/test_plugin_endpoint.py

@ephraimbuddy
Copy link
Contributor Author

We already have tests to test the endpoint, but those fields are all empty in the stub plugin so it does not reflect the change. Maybe it would be possible to add those to the test.

https://github.com/apache/airflow/blob/main/tests/api_connexion/endpoints/test_plugin_endpoint.py

Yeah, Looking at adding possible items to the fields

@ephraimbuddy ephraimbuddy merged commit 474fa4d into apache:main Oct 12, 2023
43 checks passed
@ephraimbuddy ephraimbuddy deleted the fix-plugin-api branch October 12, 2023 11:56
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Oct 27, 2023
@ephraimbuddy ephraimbuddy added this to the Airflow 2.7.3 milestone Oct 27, 2023
ephraimbuddy added a commit that referenced this pull request Oct 29, 2023
* REST API: Fix wrong plugin schema

We serialize some plugin's fields as dictionaries leading to errors
when accessing the `/plugins` endpoint.

Here's the error:
ValueError: dictionary update sequence element #0 has length 1; 2 is required

The fields are lists of strings and this PR addresses it.

* fixup! REST API: Fix wrong plugin schema

* Add test at the endpoint

* fixup! Add test at the endpoint

(cherry picked from commit 474fa4d)
ephraimbuddy added a commit that referenced this pull request Oct 30, 2023
* REST API: Fix wrong plugin schema

We serialize some plugin's fields as dictionaries leading to errors
when accessing the `/plugins` endpoint.

Here's the error:
ValueError: dictionary update sequence element #0 has length 1; 2 is required

The fields are lists of strings and this PR addresses it.

* fixup! REST API: Fix wrong plugin schema

* Add test at the endpoint

* fixup! Add test at the endpoint

(cherry picked from commit 474fa4d)
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:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants