Skip to content

GNNTable.remove_column()

Remove an existing column from the GNN table. If the column is used as a candidate key, foreign key, or time column, it will be removed from those roles as well.

NameTypeDescriptionOptional
col_namestrThe name of the column to remove from the GNN table.No

Raises ValueError if the column does not exist in the GNN table.

from relationalai_gnns import GNNTable, CandidateKey
table_with_ckey = GNNTable(
connector=connector,
name="TableWithCKey",
source="DATABASE.SCHEMA.TABLE_WITH_CKEY",
type="node",
candidate_keys=[CandidateKey(column_name="Id")]
)
# Do not use this column as an input feature for the GNNTable
table_with_ckey.remove_column(col_name="some_column_name")