-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The ReferenceApi().reference_bmunits_all_get() doesn't work. It raises an UnboundLocalError: local variable 'change_to_dataframe' referenced before assignment in ApiClient.__call_api.
To Reproduce
import elexonpy.api as elex
data = elex.ReferenceApi().reference_bmunits_all_get()
Expected behavior
Additional context
change_to_dataframe is only assigned inside this if statement in ApiClient.__call_api
# query parameters
if query_params:
change_to_dataframe, query_params = self.format_to_dataframe(query_params)
query_params = self.sanitize_for_serialization(query_params)
query_params = self.parameters_to_tuples(query_params,
collection_formats)
and then is referenced later
if _return_http_data_only:
if change_to_dataframe:
return_data = pd.DataFrame([data.to_dict() for data in return_data.data])
return (return_data)
but query_params is [] in the api
class ReferenceApi(object):
...
def reference_bmunits_all_get_with_http_info(self, **kwargs): # noqa: E501
...
query_params = []
...
return self.api_client.call_api(
'/reference/bmunits/all', 'GET',
path_params,
query_params,
header_params, ...)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working