Skip to content

Metadata should be able to auto-detect cases where a primary key is also a foreign key (column_name_match algorithm) #2788

@npatki

Description

@npatki

Problem Description

In SDV 2779, we'll be allowing schemas where the primary key of a table is also the foreign key into a different table. This type of data pattern is typically used when there is a 1-to-1 relationship between the tables.

In that issue, we'll make sure the metadata will validate and that we can make synthetic data for it down-the-line. But it would be nice if the metadata were able to auto-detect this as well.

Expected behavior

For SDV Community, only the 'column_name_match' algorithm is support when inferring foreign keys (see API). For this algorithm, we should ensure that a primary key also become a candidate to be a foreign key into another table.

Note that we should be careful in making sure that our updated algorithm does not create any cycles in the graph, as that is no longer valid.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions