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_primary_key

Metadata.get_primary_key(table_name)[source]

Get the name of the primary key of the indicated table, if it has one.

Parameters

table_name (str) – Name of table for which to get the primary key field.

Returns

Primary key field name. None if the table has no primary key.

Return type

str or None

Raises

ValueError – If table does not exist in this metadata.