Danger

You are looking at the documentation for an older version of the SDV! We are no longer supporting or maintaining this version of the software

Click here to go to the new docs pages.

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]