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

cvat-sdk==2.21.1 api_client.jobs_api.retrieve_data_meta TypeError #8561

Open
2 tasks done
mikeedi opened this issue Oct 18, 2024 · 0 comments
Open
2 tasks done

cvat-sdk==2.21.1 api_client.jobs_api.retrieve_data_meta TypeError #8561

mikeedi opened this issue Oct 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mikeedi
Copy link

mikeedi commented Oct 18, 2024

Actions before raising this issue

  • I searched the existing issues and did not find anything similar.
  • I read/searched the docs

Steps to Reproduce

Get TypeError: DataMetaRead._from_openapi_data() missing 1 required positional argument: 'chunks_updated_date'

Code to reproduce:

from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *

# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
    host = "###",
    username = "##",
    password = "###"
)
with ApiClient(configuration) as api_client:
    (data, response) = api_client.jobs_api.retrieve_data_meta(1286,) # existed job

Full error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[6], line 2
      1 with ApiClient(configuration) as api_client:
----> 2     (data, response) = api_client.jobs_api.retrieve_data_meta(1286,)

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/api/jobs_api.py:2551, in JobsApi.retrieve_data_meta(self, id, _parse_response, _request_timeout, _validate_inputs, _validate_outputs, _check_status, _spec_property_naming, _content_type, _host_index, _request_auths, _async_call, **kwargs)
   2549 kwargs['_request_auths'] = _request_auths
   2550 kwargs['id'] = id
-> 2551 return self.retrieve_data_meta_endpoint.call_with_http_info(**kwargs)

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/api_client.py:1073, in Endpoint.call_with_http_info(self, _parse_response, _request_timeout, _validate_inputs, _validate_outputs, _check_status, _spec_property_naming, _content_type, _host_index, _request_auths, _async_call, **kwargs)
   1070             if content_types_list:
   1071                 params['header']['Content-Type'] = content_types_list
-> 1073 return self.api_client.call_api(
   1074     self.settings['endpoint_path'], self.settings['http_method'],
   1075     params['path'],
   1076     params['query'],
   1077     params['header'],
   1078     body=params['body'],
   1079     post_params=params['form'],
   1080     files=params['file'],
   1081     response_schema=self.settings['response_schema'],
   1082     auth_settings=self.settings['auth'],
   1083     _async_call=kwargs['_async_call'],
   1084     _check_type=kwargs['_validate_outputs'],
   1085     _check_status=kwargs['_check_status'],
   1086     _parse_response=kwargs['_parse_response'],
   1087     _request_timeout=kwargs['_request_timeout'],
   1088     _host=_host,
   1089     _request_auths=kwargs['_request_auths'],
   1090     collection_formats=params['collection_format'])

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/api_client.py:502, in ApiClient.call_api(self, resource_path, method, path_params, query_params, header_params, body, post_params, files, response_schema, auth_settings, collection_formats, _async_call, _parse_response, _request_timeout, _host, _check_type, _request_auths, _check_status)
    481 params = {
    482     "resource_path": resource_path,
    483     "method": method,
   (...)
    498     "_check_status": _check_status,
    499 }
    501 if not _async_call:
--> 502     return self.__call_api(**params)
    504 return self.pool.apply_async(self.__call_api, (), kwds=params)

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/api_client.py:287, in ApiClient.__call_api(self, resource_path, method, path_params, query_params, header_params, body, post_params, files, response_schema, auth_settings, collection_formats, _parse_response, _request_timeout, _host, _check_type, _check_status, _request_auths)
    284     self._update_cookies_from_response(response)
    286     if response_schema:
--> 287         return_data = self.deserialize(
    288             response,
    289             response_schema,
    290             _check_type=_check_type
    291         )
    293 return (return_data, response)

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/api_client.py:394, in ApiClient.deserialize(self, response, response_schema, _check_type)
    390     received_data = response_data
    392 # store our data under the key of 'received_data' so users have some
    393 # context if they are deserializing a string and the data type is wrong
--> 394 deserialized_data = validate_and_convert_types(
    395     received_data,
    396     response_schema,
    397     ['received_data'],
    398     True,
    399     _check_type,
    400     configuration=self.configuration
    401 )
    402 return deserialized_data

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/model_utils.py:1590, in validate_and_convert_types(input_value, required_types_mixed, path_to_item, spec_property_naming, _check_type, configuration)
   1585 if not valid_type:
   1586     if (configuration
   1587             or (input_class_simple == dict
   1588                 and dict not in valid_classes)):
   1589         # if input_value is not valid_type try to convert it
-> 1590         converted_instance = attempt_convert_item(
   1591             input_value,
   1592             valid_classes,
   1593             path_to_item,
   1594             configuration,
   1595             spec_property_naming,
   1596             key_type=False,
   1597             must_convert=True,
   1598             check_type=_check_type
   1599         )
   1600         return converted_instance
   1601     else:

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/model_utils.py:1470, in attempt_convert_item(input_value, valid_classes, path_to_item, configuration, spec_property_naming, key_type, must_convert, check_type)
   1468 try:
   1469     if issubclass(valid_class, OpenApiModel):
-> 1470         return deserialize_model(input_value, valid_class,
   1471                                  path_to_item, check_type,
   1472                                  configuration, spec_property_naming)
   1473     elif valid_class == file_type:
   1474         return deserialize_file(input_value, configuration)

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/model_utils.py:1384, in deserialize_model(model_data, model_class, path_to_item, check_type, configuration, spec_property_naming)
   1382 if isinstance(model_data, dict):
   1383     kw_args.update(model_data)
-> 1384     return model_class._new_from_openapi_data(**kw_args)
   1385 elif isinstance(model_data, PRIMITIVE_TYPES):
   1386     return model_class._new_from_openapi_data(model_data, **kw_args)

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/model_utils.py:51, in convert_js_args_to_python_args.<locals>.wrapped_init(_self, *args, **kwargs)
     47 if spec_property_naming:
     48     kwargs = change_keys_js_to_python(
     49         kwargs, _self if isinstance(
     50             _self, type) else _self.__class__)
---> 51 return fn(_self, *args, **kwargs)

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/model_utils.py:379, in OpenApiModel._new_from_openapi_data(cls, *args, **kwargs)
    358 visited_composed_classes = kwargs.get('_visited_composed_classes', ())
    359 if (
    360     cls.discriminator is None or
    361     cls in visited_composed_classes
   (...)
    376     # through Animal's discriminator because we passed in
    377     # _visited_composed_classes = (Animal,)
--> 379     return cls._from_openapi_data(*args, **kwargs)
    381 # Get the name and value of the discriminator property.
    382 # The discriminator name is obtained from the discriminator meta-data
    383 # and the discriminator value is obtained from the input data.
    384 discr_propertyname_py = list(cls.discriminator.keys())[0]

File ~/miniconda3/envs/bag/lib/python3.10/site-packages/cvat_sdk/api_client/model_utils.py:51, in convert_js_args_to_python_args.<locals>.wrapped_init(_self, *args, **kwargs)
     47 if spec_property_naming:
     48     kwargs = change_keys_js_to_python(
     49         kwargs, _self if isinstance(
     50             _self, type) else _self.__class__)
---> 51 return fn(_self, *args, **kwargs)

TypeError: DataMetaRead._from_openapi_data() missing 1 required positional argument: 'chunks_updated_date'

Also:

  • api_client.tasks_api.retrieve_data_meta throws the same
  • api_client.tasks_api.retrieve and api_client.jobs_api.retrieve works without errors
  • Not checked the other methods

Expected Behavior

Version 2.20.0 works without errors

Possible Solution

No response

Context

No response

Environment

In [2]: import cvat_sdk
In [3]: cvat_sdk.__version__
Out[3]: '2.21.1'
@mikeedi mikeedi added the bug Something isn't working label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant