Skip to content
New issue

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

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

Already on GitHub? # to your account

airflow_client.client.exceptions.ApiValueError: Unsupported type: <class 'object'> for any API requests #15

Closed
dimberman opened this issue May 12, 2021 · 3 comments
Assignees

Comments

@dimberman
Copy link

dimberman commented May 12, 2021

>>> from airflow_client.client.api import dag_api
>>> api_instance = dag_api.DAGApi(api_client)
>>> api_instance.get_dags()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/api_client.py", line 789, in __call__
    return self.callable(self, *args, **kwargs)
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/api/dag_api.py", line 486, in __get_dags
    return self.call_with_http_info(**kwargs)
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/api_client.py", line 867, in call_with_http_info
    collection_formats=params['collection_format'])
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/api_client.py", line 432, in call_api
    _check_type)
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/api_client.py", line 244, in __call_api
    _check_type
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/api_client.py", line 348, in deserialize
    configuration=self.configuration
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/model_utils.py", line 1420, in validate_and_convert_types
    check_type=_check_type
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/model_utils.py", line 1287, in attempt_convert_item
    valid_classes_ordered = order_response_types(valid_classes)
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/model_utils.py", line 920, in order_response_types
    key=lambda class_or_instance: index_getter(class_or_instance)
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/model_utils.py", line 920, in <lambda>
    key=lambda class_or_instance: index_getter(class_or_instance)
  File "/Users/dimberman/.virtualenvs/pytest-bdd/lib/python3.7/site-packages/airflow_client/client/model_utils.py", line 916, in index_getter
    raise ApiValueError("Unsupported type: %s" % class_or_instance)
airflow_client.client.exceptions.ApiValueError: Unsupported type: <class 'object'>

I think the new version of OpenAPI might have broken the client. I get these from following most of the examples except config. @mik-laj any idea what might cause this?

@dimberman
Copy link
Author

https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.1.1 seems this is fixed in OpenApi 5.1.1. There's an issue with array items.

@msumit
Copy link
Contributor

msumit commented May 12, 2021

Yup, verified. We need to upgrade to open API generator 5.1.1 to fix this issue.

>>> api_instance.get_dags()
{'dags': [], 'total_entries': 0}

@msumit
Copy link
Contributor

msumit commented Jun 1, 2021

Fixed in 2.1.0 release.

@msumit msumit closed this as completed Jun 1, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants