diff --git a/python_modules/libraries/dagster-components/dagster_components/core/schema/metadata.py b/python_modules/libraries/dagster-components/dagster_components/core/schema/metadata.py index fee035d49e77f..f52ef4bea6052 100644 --- a/python_modules/libraries/dagster-components/dagster_components/core/schema/metadata.py +++ b/python_modules/libraries/dagster-components/dagster_components/core/schema/metadata.py @@ -65,7 +65,9 @@ def _subschemas_on_path( # List[ComplexType] (e.g.) will contain a reference to the complex type schema in the # top-level $defs, so we dereference it here. if "$ref" in subschema: - subschema = json_schema["$defs"].get(subschema["$ref"][len(REF_BASE) :]) + # depending on the pydantic version, the extras may be stored with the reference or not + extras = {k: v for k, v in subschema.items() if k != "$ref"} + subschema = {**json_schema["$defs"].get(subschema["$ref"][len(REF_BASE) :]), **extras} yield subschema if len(valpath) == 0: diff --git a/python_modules/libraries/dagster-components/dagster_components_tests/rendering_tests/test_schema_resolution.py b/python_modules/libraries/dagster-components/dagster_components_tests/rendering_tests/test_schema_resolution.py index 4cc192a68d050..aa6a5e40667c8 100644 --- a/python_modules/libraries/dagster-components/dagster_components_tests/rendering_tests/test_schema_resolution.py +++ b/python_modules/libraries/dagster-components/dagster_components_tests/rendering_tests/test_schema_resolution.py @@ -70,8 +70,8 @@ def test_allow_render(path, expected: bool) -> None: (["inner_seq"], set()), (["container_optional_scoped"], {"a", "b"}), (["container_optional_scoped", "inner"], {"a", "b"}), - # (["container_optional_scoped", "inner_scoped"], {"a", "b", "c", "d"}), - # (["container_optional_scoped", "inner_scoped", "a"], {"a", "b", "c", "d"}), + (["container_optional_scoped", "inner_scoped"], {"a", "b", "c", "d"}), + (["container_optional_scoped", "inner_scoped", "a"], {"a", "b", "c", "d"}), ], ) def test_get_available_scope(path, expected: Set[str]) -> None: