Skip to content

RelationalTable.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.

NameTypeDescriptionOptional
col_namestrThe name of the column to update.No
dtypeColumnDTypeThe 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
from relationalai_predictive import RelationalTable, CandidateKey
from relationalai_predictive import ColumnDType
table_with_ckey = RelationalTable(
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'))