Skip to content

ReferenceApi().reference_bmunits_all_get() doesn't work #64

@ma1jmk

Description

@ma1jmk

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

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions