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.
Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
col_name | str | The name of an existing column to set as the time column. | No |
Returns
Section titled “Returns”Raises ValueError if the column does not exist in the GNN table or if the column’s data type is not datetime.
Example
Section titled “Example”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")