v0.0.17¶
New: Alternative Keys for DbModel¶
Alternative keys (AK) provide human-readable, cross-table unique identifiers
as an alternative to auto-increment primary keys. Annotate fields with (AK)
to declare them as alternative key components.
(AK)field annotation inlythonic.state— marks fields as alternative key components.create_ddlemits aUNIQUEconstraint for AK fields.AltKeyclass — builds from a model's AK fields, computes a cascade JOIN chain across FK references, and resolves AK values to PKs viaAltKey.resolve().DbModel.resolve_ak()/load_by_ak()/to_ak_dict()— delegate methods for AK resolution, loading, and serialization directly on models.Schema.table_map— validates AK-FK references at schema construction time.
New: Reference Type Hierarchy¶
Replaces the old GRef with a proper type hierarchy for referencing Python
objects by path.
NsRef— namespace reference withscope:nameformat. Supports equality with strings, ordering (__lt__), and Pydantic serialization. Registered as aKnownTypefor DB roundtrips.GlobalRef— extendsNsReffor module-qualified Python objects (module.path:name). ReplacesGRefthroughout the codebase.ModuleRef— lightweight reference to a Python module by import path.DagPathinlythonic.compose.namespace— compound type for DAG execution paths (baseNsRef+ optional/label[idx]segments for sub-DAG iterations).DagContext.dag_nsrefnow usesDagPath.NsNodeConfig.nsrefis nowNsRef | str | Nonewith a model validator that defaults fromgrefwhen omitted.
Changed¶
NamespaceNode.nsrefproperty returnsNsRefinstead ofstr. Callers that need a string usestr(node.nsref).Namespace.__getattr__removed — dot-access to nodes by leaf name was unused outside its own tests. Usens.get("nsref")instead.lythonic.periodicmodule removed in favor of externalcrontierpackage.
Fixes¶
- Flaky CI test —
test_pushback_recorded_on_exceptionrelied on probabilistic refresh with p≈0.995, causing ~0.5% flake rate. Now patchesrandom.randomto guarantee the refresh path. - basedpyright warnings — suppressed false positives on classmethod
TypeVarresolution inDbModel.load_by_id/load_by_ak.