Example Code does not work
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing both examples linked in the python-client page and on PyPI with Python 3.10 on Windows. Trace the failures through default_api.py, api_client.py, model_utils.py, red_notices.py, and red_notices_embedded.py, focusing on the reported deserialization errors. Done means both published examples run without either traceback.
Written by the indexing model from the issue text.
Description
The example code on this page: https://github.com/bundesAPI/interpol-api/tree/main/python-client does not work.
Python Version: 3.10
OS: Windows 10 64-Bit
This is the stacktrace:
Traceback (most recent call last):
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\main.py", line 33, in <module>
api_response = api_instance.notices_v1_red_get(forename=forename, name=name, nationality=nationality, age_max=age_max, age_min=age_min, free_text=free_text, sex_id=sex_id,
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api\default_api.py", line 263, in notices_v1_red_get
return self.notices_v1_red_get_endpoint.call_with_http_info(**kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api_client.py", line 950, in call_with_http_info
return self.api_client.call_api(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api_client.py", line 432, in call_api
return self.__call_api(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api_client.py", line 236, in __call_api
return_data = self.deserialize(response_data, response_type, _check_type)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api_client.py", line 344, in deserialize
deserialized_data = validate_and_convert_types(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1607, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1468, in attempt_convert_item
return deserialize_model(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1378, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 358, in _new_from_openapi_data
return cls._from_openapi_data(*args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model\red_notices.py", line 202, in _from_openapi_data
setattr(self, var_name, var_value)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 179, in __setattr__
self[attr] = value
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 496, in __setitem__
self.set_attribute(name, value)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 155, in set_attribute
value = validate_and_convert_types(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1607, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1468, in attempt_convert_item
return deserialize_model(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1378, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 358, in _new_from_openapi_data
return cls._from_openapi_data(*args, **kwargs)
TypeError: RedNoticesLinks._from_openapi_data() got multiple values for argument '_self'
Process finished with exit code 1
Also, the example code on PyPi.org does not work: https://pypi.org/project/de-interpol
The stacktrace is:
Traceback (most recent call last):
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\main.py", line 36, in <module>
api_response = api_instance.notices_v1_red_get(forename=forename, name=name, nationality=nationality, age_max=age_max, age_min=age_min, free_text=free_text, sex_id=sex_id,
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api\default_api.py", line 263, in notices_v1_red_get
return self.notices_v1_red_get_endpoint.call_with_http_info(**kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api_client.py", line 950, in call_with_http_info
return self.api_client.call_api(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api_client.py", line 432, in call_api
return self.__call_api(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api_client.py", line 236, in __call_api
return_data = self.deserialize(response_data, response_type, _check_type)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\api_client.py", line 344, in deserialize
deserialized_data = validate_and_convert_types(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1607, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1481, in attempt_convert_item
raise conversion_exc
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1468, in attempt_convert_item
return deserialize_model(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1378, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 358, in _new_from_openapi_data
return cls._from_openapi_data(*args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model\red_notices.py", line 202, in _from_openapi_data
setattr(self, var_name, var_value)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 179, in __setattr__
self[attr] = value
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 496, in __setitem__
self.set_attribute(name, value)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 155, in set_attribute
value = validate_and_convert_types(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1607, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1481, in attempt_convert_item
raise conversion_exc
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1468, in attempt_convert_item
return deserialize_model(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1378, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 358, in _new_from_openapi_data
return cls._from_openapi_data(*args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model\red_notices_embedded.py", line 181, in _from_openapi_data
setattr(self, var_name, var_value)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 179, in __setattr__
self[attr] = value
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 496, in __setitem__
self.set_attribute(name, value)
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 155, in set_attribute
value = validate_and_convert_types(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1657, in validate_and_convert_types
input_value[index] = validate_and_convert_types(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1607, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "C:\Users\Kevin\Documents\PyCharmProjects\bot-hektor-interpol\venv\lib\site-packages\deutschland\interpol\model_utils.py", line 1462, in attempt_convert_item
raise get_type_error(
deutschland.interpol.exceptions.ApiTypeError: Invalid type for variable '0'. Required value type is str and passed type was dict at ['received_data']['embedded']['notices'][0]
Process finished with exit code 1
- Dominant language
- Python
- Stars
- 16
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bundesAPI/interpol-api
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
bundesAPI/interpol-api#11 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
bundesAPI/interpol-api#10 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
bundesAPI/interpol-api#9 · 1 comment · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
bundesAPI/interpol-api#7 · 3 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in bundesAPI/interpol-api
Similar issues
-
bug ci good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
documentation
Difficulty 2/5 Half a day Newbie friendliness 62/100
inmanta/inmanta-core#10835 ·
-
sponsored
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Diaoul/subliminal#1382 ·