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.