WingCode opened a new issue #16590:
URL: https://github.com/apache/superset/issues/16590


   dashboard_get function call using OpenApi Python Client fails
   
   ### Expected results
   
   Get back list of dashboard objects.
   
   ### Actual results
   <details>
    <summary>Error logs</summary>
   Traceback (most recent call last):
     File "superset_py/openapi_client/model_utils.py", line 1436, in 
attempt_convert_item
       raise conversion_exc
     File "superset_py/openapi_client/model_utils.py", line 1427, in 
attempt_convert_item
       return deserialize_model(input_value, valid_class,
     File "superset_py/openapi_client/model_utils.py", line 1347, in 
deserialize_model
       return model_class._new_from_openapi_data(**kw_args)
     File "superset_py/openapi_client/model_utils.py", line 44, in wrapped_init
       return fn(_self, *args, **kwargs)
     File "superset_py/openapi_client/model_utils.py", line 343, in 
_new_from_openapi_data
       return cls._from_openapi_data(*args, **kwargs)
     File "superset_py/openapi_client/model_utils.py", line 44, in wrapped_init
       return fn(_self, *args, **kwargs)
     File "superset_py/openapi_client/model/inline_response20014.py", line 203, 
in _from_openapi_data
       setattr(self, var_name, var_value)
     File "superset_py/openapi_client/model_utils.py", line 183, in __setattr__
       self[attr] = value
     File "superset_py/openapi_client/model_utils.py", line 483, in __setitem__
       self.set_attribute(name, value)
     File "superset_py/openapi_client/model_utils.py", line 155, in 
set_attribute
       value = validate_and_convert_types(
     File "superset_py/openapi_client/model_utils.py", line 1590, in 
validate_and_convert_types
       input_value[index] = validate_and_convert_types(
     File "superset_py/openapi_client/model_utils.py", line 1540, in 
validate_and_convert_types
       converted_instance = attempt_convert_item(
     File "superset_py/openapi_client/model_utils.py", line 1422, in 
attempt_convert_item
       raise get_type_error(input_value, path_to_item, valid_classes,
   openapi_client.exceptions.ApiTypeError: Invalid type for variable '0'. 
Required value type is str and passed type was int at 
['received_data']['ids'][0]
   python-BaseException
   ```
   </details>
   
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   #### How to reproduce the bug
   Download the OpenAPI spec from http://localhost:8088/api/v1/_openapi
   Generate client
   ```shell
   java -jar openapi-generator-cli.jar generate -i ./openapi_superset.json -g 
python -o ./superset_py/ --skip-validate-spec
   ```
   Test code
   ```python
   import openapi_client
   from openapi_client.api.dashboards_api import DashboardsApi
   configuration = openapi_client.Configuration(
       host= "http://localhost:8088/api/v1";,
       username="admin",
       password="admin")
   api_client = openapi_client.ApiClient(configuration)
   dashboard_api = DashboardsApi(api_client)
   dashboards = dashboard_api.dashboard_get()
   ```
   
   ### Environment
   - superset version: `1.3.0`
   - python version: `3.8.5`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to