Use dataclasses to define Glue Data Catelog
Project description
Monomer
DRY AWS CDK Construct for Glue Catelogs with dataclasses
Usage
Decorate a dataclass with @persist
Column definitions are automatically generated based off the field data, relationships are created for any field that had a type of another dataclass. Column definitions can be passed to mortar via the metadata attribute of the field() method (provided by dataclass). Partial Column data can also be passed any other required fields of the column will be generated based off the field definition.
Primary Keys
mortar will try to find the proper primary key for a defined class. It will evaluate the columns in this order to find a primary key:
- Checks for predefined key via A partial column definition
Column(primary_key=True)
- Check for a column named <class_name.lower()>_id
- check for an id column name
- create and auto increment column designated as primary key
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.