Skip to content

Implement relational schema parsing, ForeignKeyRelation, and DAG topological sort (Kahn's). - #137

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
cl/965535084
Open

Implement relational schema parsing, ForeignKeyRelation, and DAG topological sort (Kahn's).#137
copybara-service[bot] wants to merge 1 commit into
mainfrom
cl/965535084

Conversation

@copybara-service

Copy link
Copy Markdown

Implement relational schema parsing, ForeignKeyRelation, and DAG topological sort (Kahn's).

  • Implements ForeignKeyRelation dataclass with group capacity bound (max_children_per_parent >= 1) validation.
  • Implements topological_sort_hierarchy using a tree-constrained Kahn's algorithm to validate DAG hierarchies (enforcing in-degree <= 1, cycle detection, and root privacy unit identification) and compute topological synthesis depth levels.
  • Implements from_dict and from_yaml_file to parse multi-table domain schemas and foreign key constraints into typed dpsynth.domain.AttributeType specifications.
  • Adds comprehensive unit tests in domain_test.py covering linear chains, branching hierarchies, forests, cycle detection, multi-parent violations, and YAML roundtrips.

…logical sort (Kahn's).

- Implements `ForeignKeyRelation` dataclass with group capacity bound (`max_children_per_parent >= 1`) validation.
- Implements `topological_sort_hierarchy` using a tree-constrained Kahn's algorithm to validate DAG hierarchies (enforcing in-degree <= 1, cycle detection, and root privacy unit identification) and compute topological synthesis depth levels.
- Implements `from_dict` and `from_yaml_file` to parse multi-table domain schemas and foreign key constraints into typed `dpsynth.domain.AttributeType` specifications.
- Adds comprehensive unit tests in `domain_test.py` covering linear chains, branching hierarchies, forests, cycle detection, multi-parent violations, and YAML roundtrips.

PiperOrigin-RevId: 965535084
@google-cla

google-cla Bot commented Aug 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants