Skip to content

BUG: return statement missing frost_sta_client/model/location.py L168-L171 #38

Open
@jfabius

Description

@jfabius

Line 168-171:
https://github.com/FraunhoferIOSB/FROST-Python-Client/blob/master/frost_sta_client/model/location.py#L168

now

        if isinstance(values, entity_list.EntityList) and \
                all(isinstance(hl, historical_location.HistoricalLocation) for hl in values.entities):
            self._historical_locations = values
        raise ValueError('historical_location should be of type HistoricalLocation!')

issue
service.locations().query().expand("HistoricalLocations").list()
will now raise the ValueError on line 171, because after assignment of self._historical_locations = values function is not returned, but continues to raising ValueError, even though no actual error occured.

proposal

        if isinstance(values, entity_list.EntityList) and \
                all(isinstance(hl, historical_location.HistoricalLocation) for hl in values.entities):
            self._historical_locations = values
            return
        raise ValueError('historical_location should be of type HistoricalLocation!')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions