Skip to content

Uploading data with POD types

To upload tables containing POD types to the data catalog, use:

[Copy Code](javascript:void(0)) Python
import random import string from research_sdk import Dataframe, DataStorageInterface, DataStorageType, TableColumn _random_strings = set()

Declaring table schema

Table schema is the list of TableColumn. Every TableColumn defines a column name and column type. The type is set as the python type for POD values and wrappers for objects, because if there are no wrappers, it's impossible to detect a proper type to store objects.

To declare a table schema, use:

[Copy Code](javascript:void(0)) Python
table_schema = [ TableColumn("count", float), TableColumn("weight", int), TableColumn("length", int), TableColumn("code", str), TableColumn("id", str), TableColumn("valid", bool), ] table_data = list()
InformationSometimes the schema may be read from the data through the Dataframe.create_schema_from_data() static method, but it is not recommended because the detection of non-POD types does not work and may fail to read wide objects like RawObject.