CandidateKey
Helper class for defining candidate keys of tables. A candidate key is a column in a table that can uniquely identify each record, ensuring that no two rows have the same key value. A table can have more than one candidate key columns.
Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
column_name | str | Name of the candidate key column. | No |
is_feature | str | Indicates whether the candidate key is to be considered a Graph Neural Network (GNN) feature. Default is False. | Yes. |
Returns
Section titled “Returns”An instance of the CandidateKey class.
Example
Section titled “Example”from relationalai_gnns import GNNTable, CandidateKey
candidate_key = CandidateKey(column_name="studentId")
students_table = GNNTable( connector=connector, name="Students", source="SYNTH_DB.SYNTH_SCHEMA.STUDENTS", candidate_keys=[candidate_key])