Skip to content

GNNTable.set_time_column()

Set an existing column in the GNN table as the time column. If a different time column is already set, it will be replaced.

NameTypeDescriptionOptional
col_namestrThe name of an existing column to set as the time column.No

Raises ValueError if the column does not exist in the GNN table or if the column’s data type is not datetime.

from relationalai_gnns import GNNTable, CandidateKey
table_with_time = GNNTable(
connector=connector,
name="TableWithTime",
source="DATABASE.SCHEMA.TABLE_WITH_TIME",
type="node",
candidate_keys=CandidateKey(column_name="IdColumn")
)
table_with_time.set_time_column(col_name="date")