GNNTable.update_column_dtype()
Updates the data type of existing column in the GNN table. The column must already exist in the table. If it does not, it must be added first with the add_column method.
Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
col_name | str | The name of the column to update. | No |
dtype | ColumnDType | The new data type to assign to the column can be ColumnDType('text'), ColumnDType('integer'), ColumnDType('float'), ColumnDType('category'), ColumnDType('multi_categorical'), ColumnDType('embedding') or ColumnDType('datetime'). Detailed descriptions of each type can be found in Column DTypes. | No |
Example
Section titled “Example”from relationalai_gnns import GNNTable, CandidateKeyfrom relationalai_gnns import ColumnDType
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.update_column_dtype(col_name="some_float_column_name", dtype=ColumnDType('float'))