sdv.metadata.dataset.Metadata.get_foreign_keys

Metadata.get_foreign_keys(parent, child)[source]

Get the name of all the fields in the child that are foreign keys to this parent.

If there is no relationship between the two tables an empty list is returned.

Parameters
  • parent (str) – Name of the parent table.

  • child (str) – Name of the child table.

Returns

List of foreign key names.

Return type

list[str]