FraunhoferIOSB / FROST-Python-Client

Python Client Library for FROST.
GNU Lesser General Public License v3.0
8 stars 8 forks source link

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

Open jfabius opened 3 months ago

jfabius commented 3 months ago

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!')