Techdebt refatorar modulo de pre processamento codex neodv 1697#100
Conversation
| class InvalidPreprocessingError(Exception): | ||
| """Invalid preprocessing error.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| message: str = "Not a valid Neomaril preprocessing instance. `register` or `use_exisisting_preprocessing`.", | ||
| ) -> None: | ||
| super().__init__(message) | ||
| self.message = message | ||
|
|
||
| def __str__(self): | ||
| return f"Could not send request, invalid Neomaril preprocessing instance." |
There was a problem hiding this comment.
What do you think we create a python package for exception and centralize this?
There was a problem hiding this comment.
A package with just exceptions? Is this the pattern in python?
| class SyncPreprocessingClient: | ||
| """ | ||
| Preprocessing base client. | ||
| """ | ||
|
|
||
| def __init__(self, token: str): |
There was a problem hiding this comment.
Note: I think we should use pydantic even though we won't use all the feautures
There was a problem hiding this comment.
Thinking about this one, if I do this change I cannot make __bearer_token a private attribute.
| def register(self, sp: SyncPreprocessing) -> NeomarilSyncPreprocessing: | ||
| """ | ||
| List all MLOps groups the user has access to. | ||
|
|
||
| Returns: | ||
| list[str]: List of MLOps groups the user has access to. | ||
|
|
||
| """ |
There was a problem hiding this comment.
In my opinion, we should not shorten terms because it should be descriptive for the user.
Also, missing the parameter sp should be in the docstring because sphinx will generate the docs based on the docstrings
There was a problem hiding this comment.
doc strings are wrong, you can ignore them for now.
|
|
||
| Attributes: | ||
| name (str): human identifier. | ||
| python_version (str): a Neomaril supported python version. |
There was a problem hiding this comment.
I think we should inform the available options
There was a problem hiding this comment.
I think we should link neomaril doc here.
a4ea774 to
a420abb
Compare
Description
This PR:
sync preprocessinginterface and implementationasync preprocessing v1interface and implementationRelated issues
How to test it (sync preprocessing)
python -i src/mlops_codex/sync_preprocessing/client.pyHow to test it (async preprocessing)
python -i src/mlops_codex/async_preprocessingV1/client.py