diepvries.hub module

A Hub.

class diepvries.hub.Hub(schema, name, fields, *_args, **_kwargs)

Bases: DataVaultTable

A hub.

property entity_name: str

Get entity name for current Hub.

Entity name corresponds to the name of the table, without the prefix.

Return type:

str

Returns:

Name of the entity.

property loading_order: int

Get loading order (hubs are the first tables to be loaded).

Return type:

int

Returns:

Table loading order.

property prefix: str

Get table prefix.

Return type:

str

Returns:

Table prefix.

property sql_load_statement: str

Get the SQL query to populate current hub.

All needed placeholders are calculated, in order to match template SQL (check template_sql.hub_link_dml.sql).

Return type:

str

Returns:

SQL query to load target hub.

property sql_placeholders: Dict[str, str]

Hub specific SQL placeholders.

These placeholders are used to format the hub loading query.

The results are joined with the results from super().sql_placeholders(), as all placeholders calculated in Table (parent class) are applicable in a Satellite.

Return type:

Dict[str, str]

Returns:

Satellite specific SQL placeholders.

staging_table: StagingTable