Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jfabius opened this issue Jul 16, 2024 · 1 comment

Comments

@jfabius
Copy link

jfabius commented Jul 16, 2024

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!')
@reraroru
Copy link
Contributor

reraroru commented Dec 5, 2024

Thank you for the hint. We will fix this.

reraroru added a commit that referenced this issue Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants