Skip to content

GNNTable.unset_candidate_key()

Unset an existing column as a candidate key in the GNN table. This will remove the column from its role as candidate key.

NameTypeDescriptionOptional
col_nameCandidateKeyThe candidate key definition to unset.No

Raises ValueError if the column does not exist in the GNN table or KeyError if the column is not currently set as a candidate key.

from relationalai_gnns import GNNTable, CandidateKey
table_with_ckey = GNNTable(
connector=connector,
name="TableWithCKey",
source="DATABASE.SCHEMA.TABLE_WITH_CKEY",
type="node",
candidate_keys=[CandidateKey(column_name="Id")]
)
table_with_ckey.unset_candidate_key(col_name="Id")