This Python package contains a set of frequently used functions for using in DAGs.
Project description
Brusnika Airflow Package
This Python package contains a set of frequently used functions for using in DAGs.
Table of Contents
- Quick Start
- Functions
- grants_for_table
- generate_table_name_for_temp_store
- create_empty_table_like_this
- copy_data_between_tables
- copy_data_between_tables_without_trancate
- table_exists
Quick Start
Install the package:
pip install brusnika_airflow
Functions
-
grants_for_table(pg_hook, schema, table)
: Grants privileges to a user on a specific table. -
generate_table_name_for_temp_store(table_prefix)
: Generates a temporary table name for storing data temporarily. -
create_empty_table_like_this(pg_hook, source_schema, source_table, destination_schema, destination_table)
: Creates an empty table with the same structure as the source table. -
copy_data_between_tables(pg_hook, source_schema, source_table, destination_schema, destination_table)
: Truncate data in the destination table. Copies data from the source table to the destination table and then deletes the source table. -
copy_data_between_tables_without_trancate(pg_hook, source_schema, source_table, destination_schema, destination_table)
: Copies data from the source table to the destination table and then deletes the source table. -
copy_data_between_tables_with_deleting_data(pg_hook, source_schema, source_table, destination_schema, destination_table, delete_clause)
: Delete data in the destination table with use delete_clause condition. Copies data from the source table to the destination table and then deletes the source table. -
table_exists(pg_hook, schema, table)
: Checks if a table exists in a given schema. -
dtypes_for_sql(dataframe, json_columns)
: Create dtype for dataframe with json.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for brusnika_airflow-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 876977f3037fd9a5caea036929fe407b3828db9512efe2f531e6518167089c3b |
|
MD5 | 2b3430f1b46a67e7bbe8f5866750d81d |
|
BLAKE2b-256 | bfda5bcab5532d0b12440c0a85fc1149935fdac5e3c774fc98b6c48ad56025c9 |