Skip to content

Commit

Permalink
improve type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
Agamemnon Krasoulis committed Dec 7, 2024
1 parent 5c8ac36 commit 49dbbef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pipelines/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def load_context(self, context: PythonModelContext) -> None:
def predict(
self,
context: PythonModelContext, # noqa: ARG002
model_input: pd.DataFrame | list | dict,
model_input: pd.DataFrame | list[dict[str, Any]] | dict[str, Any] | list[Any],
params: dict[str, Any] | None = None,
) -> list:
"""Handle the request received from the client.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def test_predict_return_empty_list_on_invalid_prediction(model, monkeypatch):
"input_data",
[
pd.DataFrame([{"island": "Torgersen", "culmen_length_mm": 39.1}]),
["Torgersen", 39.1],
{"island": "Torgersen", "culmen_length_mm": 39.1},
[{"island": "Torgersen", "culmen_length_mm": 39.1}],
{"island": "Torgersen", "culmen_length_mm": 39.1},
["Torgersen", 39.1],
],
)
def test_predict(model, monkeypatch, input_data):
Expand Down

0 comments on commit 49dbbef

Please sign in to comment.