Updating Schemas

Updating Category Choices

Updating Specific Categories

When you have a categorical field in your database, you may need to update the list of permissible categories due to changes in data collection or business/analytical requirements. To specify a new list of categories that replaces the old one, you can provide the column name and the new categories list:

schema_manager.update_column_categories(
    column_name="your_field_name",
    categories=['Category1', 'Category2', 'Category3']
)

Allowing Any New Category

If you want your model to accept any new category that it encounters without throwing an error, you can set the column to allow new categories dynamically:

schema_manager.update_column_categories(
    column_name="your_field_name",
    allow_new_categories=True
)

Changing Data Types and Value Ranges

Updating Data Type

As your data evolves, the initial data type of a field may no longer be appropriate. If the nature of the data in a particular field changes (e.g., from integers to strings), you need to update the data type accordingly:

schema_manager.update_column_data_type('your_field_name', 'new_data_type')

Updating Value Range

For numeric fields, you might need to adjust the minimum and maximum allowable values based on new observations or requirements:

schema_manager.update_column_range('your_field_name', new_min_value, new_max_value)

Saving Changes and Retrieving Schema

Saving to Server

schema_manager.post_schema()

Retrieving the Current Schema

current_schema = schema_manager.get_schema()
print(current_schema)

↪ Questions? Chat with an AI or talk to a product expert.

Last updated

Was this helpful?