diff --git a/docs/docs-environment.yml b/docs/docs-environment.yml index 6bb8a39e..a73346a0 100644 --- a/docs/docs-environment.yml +++ b/docs/docs-environment.yml @@ -17,7 +17,7 @@ dependencies: # install rubicon-ml dependencies # so local pip install doesn't - - dash<=2.14.2,>=2.11.0 + - dash<=2.15.0,>=2.11.0 - dash-bootstrap-components<=1.5.0,>=1.0.0 - fsspec<=2023.12.2,>=2021.4.0 - intake[dataframe]<=0.7.0,>=0.5.2 diff --git a/environment.yml b/environment.yml index 94c89fc3..151af57f 100644 --- a/environment.yml +++ b/environment.yml @@ -22,7 +22,7 @@ dependencies: - s3fs<=2023.12.2,>=0.4 # for viz extras - - dash<=2.14.2,>=2.11.0 + - dash<=2.15.0,>=2.11.0 - dash-bootstrap-components<=1.5.0,>=1.0.0 # for testing diff --git a/rubicon_ml/schema/logger.py b/rubicon_ml/schema/logger.py index cfd83ae8..7468d7d9 100644 --- a/rubicon_ml/schema/logger.py +++ b/rubicon_ml/schema/logger.py @@ -95,7 +95,11 @@ def _safe_call_func(obj, func, optional, default=None): @contextmanager def _set_temporary_schema(project, schema_name): original_schema = project.schema_ - project.set_schema(registry.get_schema(schema_name)) + + if schema_name == "infer": + delattr(project, "schema_") + else: + project.set_schema(registry.get_schema(schema_name)) yield diff --git a/setup.cfg b/setup.cfg index 5293cba1..6e0ad908 100644 --- a/setup.cfg +++ b/setup.cfg @@ -44,13 +44,13 @@ prefect = s3 = s3fs<=2023.12.2,>=0.4 ui = - dash<=2.14.2,>=2.11.0 + dash<=2.15.0,>=2.11.0 dash-bootstrap-components<=1.5.0,>=1.0.0 viz = - dash<=2.14.2,>=2.11.0 + dash<=2.15.0,>=2.11.0 dash-bootstrap-components<=1.5.0,>=1.0.0 all = - dash<=2.14.2,>=2.11.0 + dash<=2.15.0,>=2.11.0 dash-bootstrap-components<=1.5.0,>=1.0.0 prefect<=1.2.4,>=0.12.0 s3fs<=2023.12.2,>=0.4 diff --git a/tests/fixtures.py b/tests/fixtures.py index 5eb3ce82..719c6564 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -382,7 +382,7 @@ def parameter_schema(): def nested_schema(): """Returns a schema for testing nested schema.""" - return {"schema": [{"name": "AnotherObject", "attr": "object_"}]} + return {"schema": [{"name": "tests___AnotherObject", "attr": "object_"}]} @pytest.fixture diff --git a/tests/unit/schema/test_schema_logger.py b/tests/unit/schema/test_schema_logger.py index 0931a6d7..02b8ea65 100644 --- a/tests/unit/schema/test_schema_logger.py +++ b/tests/unit/schema/test_schema_logger.py @@ -212,11 +212,17 @@ def test_log_parameters_with_schema(objects_to_log, rubicon_project, parameter_s assert parameter_b.value == "param env value" -def test_log_nested_schema(objects_to_log, rubicon_project, another_object_schema, nested_schema): +@pytest.mark.parametrize("infer", [True, False]) +def test_log_nested_schema( + objects_to_log, rubicon_project, another_object_schema, nested_schema, infer +): """Testing ``Project.log_with_schema`` can log nested schema.""" + if infer: + nested_schema["schema"][0]["name"] = "infer" + object_to_log, another_object = objects_to_log - schema_to_patch = {"AnotherObject": lambda: another_object_schema} + schema_to_patch = {"tests___AnotherObject": lambda: another_object_schema} with mock.patch.dict(RUBICON_SCHEMA_REGISTRY, schema_to_patch, clear=True): rubicon_project.set_schema(nested_schema)