Skip to content

Nested subtype override silently drops containing configuration context #14

Closed

Description

@trissim

Nested configuration merging silently loses the entire override when an authored nested dataclass is a nominal subtype of the default owner.

_merge_nested_dataclass iterates subtype fields but reads each field from the base instance. A subtype-only field raises AttributeError; config_context then discards the containing override. In OpenHCS, an authored VolumeSourceSpatialDomain replaces the default XY domain. Its source_depth field triggers this failure, dropping all three NamesAndTypes image bindings and preventing fresh original 3D CellProfiler pipeline import (RescaleIntensity references unknown image artifact origDNA).

The generic merge should preserve the authored nominal owner and its fields, inherit shared base fields where an override is None, and keep explicit mask_with_none=True semantics. Lazy overlays of the same canonical owner must continue merging on the base owner. An explicit authored return to the base nominal type must also be respected.

Reproduced with public config_context controls for nested subtype/sibling bindings, masking, and nominal downgrade. This belongs in ObjectState's existing merge authority, rather than an OpenHCS importer workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions