Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Example out of doc folder fails

Aperta
#6 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Riproduci l'esempio dalla cartella doc e inizia da notices_v1_red_get in interpol/api/default_api.py, seguendo il traceback attraverso api_client.py, model_utils.py e model/red_notices.py. Il lavoro è completato quando la richiesta documentata non solleva più il TypeError segnalato e viene completata correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Installed deutschland 0.3.0 and executed the example from the doc folder:

import time
from deutschland import interpol
from deutschland.interpol.api import default_api
from deutschland.interpol.model.red_notices import RedNotices
from pprint import pprint
# Defining the host is optional and defaults to https://ws-public.interpol.int
# See configuration.py for a list of all supported configuration parameters.
configuration = interpol.Configuration(
    host = "https://ws-public.interpol.int"
)


# Enter a context with an instance of the API client
with interpol.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = default_api.DefaultApi(api_client)
    forename = "MAX" # str | First name (optional)
    name = "Mustermann" # str | Last name (optional)
    nationality = "DE" # str | Two digit country code (optional)
    age_max = 120 # int | maximum age (optional)
    age_min = 18 # int | minimum age (optional)
    free_text = "" # str | Free text query (optional)
    sex_id = "F" # str | Free text query (optional)
    arrest_warrant_country_id = "DE" # str | Two digit country code (optional)
    page = 1 # int | pagination - starts with 1 (optional)
    result_per_page = 200 # int | resultPerPage (optional)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get Red Notices
        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, arrest_warrant_country_id=arrest_warrant_country_id, page=page, result_per_page=result_per_page)
        pprint(api_response)
    except interpol.ApiException as e:
        print("Exception when calling DefaultApi->notices_v1_red_get: %s\n" % e)

Traceback (most recent call last):
  File "main.py", line 32, 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, arrest_warrant_country_id=arrest_warrant_country_id, page=page, result_per_page=result_per_page)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/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 "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api_client.py", line 950, in call_with_http_info
    return self.api_client.call_api(
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api_client.py", line 432, in call_api
    return self.__call_api(
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api_client.py", line 236, in __call_api
    return_data = self.deserialize(response_data, response_type, _check_type)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api_client.py", line 344, in deserialize
    deserialized_data = validate_and_convert_types(
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1607, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1468, in attempt_convert_item
    return deserialize_model(
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1378, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 48, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 358, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 48, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model/red_notices.py", line 202, in _from_openapi_data
    setattr(self, var_name, var_value)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 179, in __setattr__
    self[attr] = value
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 496, in __setitem__
    self.set_attribute(name, value)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 155, in set_attribute
    value = validate_and_convert_types(
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1607, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1468, in attempt_convert_item
    return deserialize_model(
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1378, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 48, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 358, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
TypeError: wrapped_init() got multiple values for argument '_self'

Lingua principale
Python
Stelle
16
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bundesAPI/interpol-api

Tutte le issue di bundesAPI/interpol-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.