chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:22:34 +08:00
commit 4b22cfda96
9037 changed files with 2363717 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import pytest
import mlflow
from mlflow.exceptions import MlflowException
class UnpicklableModel(mlflow.pyfunc.PythonModel):
def __init__(self, path):
with open(path, "w+") as f:
pass
self.not_a_file = f
def test_pyfunc_unpicklable_exception(tmp_path):
model = UnpicklableModel(tmp_path / "model.pkl")
with pytest.raises(
MlflowException,
match="Please save the model into a python file and use code-based logging method instead",
):
mlflow.pyfunc.save_model(python_model=model, path=tmp_path / "model")