You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sidex-gen-py: uniform inlining + payload() translation method
All flat-record variant cases now inline the target record's fields
directly into the variant class, regardless of whether the target lives
in the same schema, a sibling schema, or a different bundle. The
previous "inherit when same-schema, inline when cross-schema" split was
fragile (sibling-schema inheritance fails at class-construction time
because `_schema_X` is `TYPE_CHECKING`-gated) and forced API consumers
to handle two shapes for the same logical case.
To preserve the conceptual link to the base record, every payload-
bearing variant case now exposes a `payload()` method that constructs
a fresh instance of the underlying type:
SettingTarget_Module(...).payload() # -> ModuleRef
ConcreteType_Table(...).payload() # -> ConcreteTableType
Cross-schema payloads use a method-local `from . import` so the
translation works even when the variant module is imported standalone,
before the bundle's `__init__.py` has wired up runtime aliases.
Externally- and adjacently-tagged variant cases get the same `payload()`
method for symmetry, returning `self.value` / `self.content`
respectively.
The previous `test_variant_e_inherits_record` / `..._inherits_generic_
record` tests asserted on inheritance; rename and rewrite them to
exercise `payload()` instead.