How to create a Python Table
Steps#
- In the portal go to
settingsand click onTables. - Click the
Create Tablebutton in the topright corner. - Fill in the form.
When the
Tablesoption is not displayed in the settings menu or you can not find theCreate Tablebutton contact a system administrator to ask for access.
Create Table Form#
| Parameter | Description |
|---|---|
| Alias | This is the name by which you reference the table when querying |
| Description | Text to specify for what the table can be used, this is optional |
| Type | The type of the table, for python tables choose brick (default) |
| Brick | The brick to use, choose one from the list |
Once you have chosen a brick, additional options appear:
| Parameter | Description |
|---|---|
| Main | The file in which the code you wish to use to make the table is present |
| Class Name | The name of the class you wish to use to make the table within the file chosen in Main |
| EventStore | Optional Eventstore |
| Secret | Secret to use, for more information visit the secrets page |
| Schema | The schema to use to specify the columns, you find the attributes in the table below |
Schema attributes#
| Attribute | Description |
|---|---|
| name | The name of the column |
| nullable | Whether the column is nullable or not |
| dict_id | Needed for some packages like pyarrow. If not needed set this to 0 |
| dict_is_ordered | Needed for some packages like pyarrow. If not needed set this to false |
| data_type | The type of the data in the column, the options are displayed in the table below |
The optional types for data are:
| Type options | Description |
|---|---|
| Utf8 | for strings |
| Int64 or Int32 | for integers |
| Float64 or Float32 | for floats |
| Boolean | for booleans |
| {"Timestamp":["Unit","TZ"]} | for timestamps |
| Unit | the unit used for conversion of the float value, valid Unit values are: Day, Hour, Minute, Second, Millisecond, Microsecond, Nanosecond |
| TZ | optional timezone info, if no timezone info is given the value of "TZ" is None |
| metadata | metadata for the column. If none metadata must still be specified as an empty dictionary |
The eventual schema should look like similar to this: