bossenti commented on code in PR #2871: URL: https://github.com/apache/streampipes/pull/2871#discussion_r1604424214
########## streampipes-client-python/streampipes/endpoint/api/version.py: ########## @@ -109,11 +109,20 @@ def get(self, identifier: str, **kwargs) -> Resource: identifier: str Not supported by this endpoint, is set to an empty string. + Raises + ------ + NotImplementedError + Non-empty 'identifier' is not supported by this endpoint. Please set 'identifier' to an empty string. + Returns ------- versions: Version The specified resource as an instance of the corresponding model class([Version][streampipes.model.resource.Version]). # noqa: 501 """ + if identifier != "": Review Comment: Shall we change that to `if identifier:`? This would allow the user to pass `None` as well which is semantically correct. ########## streampipes-client-python/streampipes/endpoint/api/version.py: ########## @@ -109,11 +109,20 @@ def get(self, identifier: str, **kwargs) -> Resource: identifier: str Not supported by this endpoint, is set to an empty string. + Raises + ------ + NotImplementedError + Non-empty 'identifier' is not supported by this endpoint. Please set 'identifier' to an empty string. + Returns ------- versions: Version The specified resource as an instance of the corresponding model class([Version][streampipes.model.resource.Version]). # noqa: 501 """ + if identifier != "": + raise NotImplementedError( Review Comment: I suggest to use `ValueError` This is not the intended use for `NotImplementedError` (https://docs.python.org/3/library/exceptions.html#NotImplementedError). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@streampipes.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org