astro.table

Module Contents

Classes

Metadata

Contains additional information to access a SQL Table, which is very likely optional and, in some cases, may

Table

User-facing class that has information necessary to access a SQL Table. It is agnostic to the database type.

Attributes

MAX_TABLE_NAME_LENGTH

TEMP_PREFIX

astro.table.MAX_TABLE_NAME_LENGTH = 62
astro.table.TEMP_PREFIX = '_tmp'
class astro.table.Metadata

Contains additional information to access a SQL Table, which is very likely optional and, in some cases, may be database-specific.

Parameters:
  • schema – A schema name

  • database – A database name

schema: str | None
database: str | None
is_empty()

Check if all the fields are None.

Return type:

bool

class astro.table.Table

Bases: BaseTable, astro.airflow.datasets.Dataset

User-facing class that has information necessary to access a SQL Table. It is agnostic to the database type. If no name is given, it auto-generates a name for the Table and considers it temporary.

Temporary tables are prefixed with the prefix TEMP_PREFIX.

Parameters:
  • name – The name of the database table. If name not provided then it would create a temporary name

  • conn_id – The Airflow connection id. This will be used to identify the right database type at the runtime

  • metadata – A metadata object which will have database or schema name

  • columns – columns which define the database table schema.

uri: str
extra: dict | None