How to create a Python Table

Steps#

  • In the portal go to settings and click on Tables.
  • Click the Create Table button in the topright corner.
  • Fill in the form.

When the Tables option is not displayed in the settings menu or you can not find the Create Table button contact a system administrator to ask for access.

Create Table Form#

ParameterDescription
AliasThis is the name by which you reference the table when querying
DescriptionText to specify for what the table can be used, this is optional
TypeThe type of the table, for python tables choose brick (default)
BrickThe brick to use, choose one from the list

Once you have chosen a brick, additional options appear:

ParameterDescription
MainThe file in which the code you wish to use to make the table is present
Class NameThe name of the class you wish to use to make the table within the file chosen in Main
EventStoreOptional Eventstore
SecretSecret to use, for more information visit the secrets page
SchemaThe schema to use to specify the columns, you find the attributes in the table below

Schema attributes#

AttributeDescription
nameThe name of the column
nullableWhether the column is nullable or not
dict_idNeeded for some packages like pyarrow. If not needed set this to 0
dict_is_orderedNeeded for some packages like pyarrow. If not needed set this to false
data_typeThe type of the data in the column, the options are displayed in the table below

The optional types for data are:

Type optionsDescription
Utf8for strings
Int64 or Int32for integers
Float64 or Float32for floats
Booleanfor booleans
{"Timestamp":["Unit","TZ"]}for timestamps
Unitthe unit used for conversion of the float value, valid Unit values are: Day, Hour, Minute, Second, Millisecond, Microsecond, Nanosecond
TZoptional timezone info, if no timezone info is given the value of "TZ" is None
metadatametadata for the column. If none metadata must still be specified as an empty dictionary

The eventual schema should look like similar to this:

{
"fields":
[{
"name":<Insert name here>,
"nullable":true,
"dict_id":0,
"dict_is_ordered":false,
"metadata":{},
"data_type": <Insert data type here>
}],
"metadata": {}
}