airflow.providers.snowflake.utils.openlineage
¶
Module Contents¶
Functions¶
|
Fix account name to have the following format: <account_id>.<region>.<cloud>. |
Fix snowflake sqlalchemy connection URI to OpenLineage structure. |
- airflow.providers.snowflake.utils.openlineage.fix_account_name(name)[source]¶
Fix account name to have the following format: <account_id>.<region>.<cloud>.
- airflow.providers.snowflake.utils.openlineage.fix_snowflake_sqlalchemy_uri(uri)[source]¶
Fix snowflake sqlalchemy connection URI to OpenLineage structure.
Snowflake sqlalchemy connection URI has following structure: ‘snowflake://<user_login_name>:<password>@<account_identifier>/<database_name>/<schema_name>?warehouse=<warehouse_name>&role=<role_name>’ We want account identifier normalized. It can have two forms: - newer, in form of <organization>-<id>. In this case we want to do nothing. - older, composed of <id>-<region>-<cloud> where region and cloud can be optional in some cases. If <cloud> is omitted, it’s AWS. If region and cloud are omitted, it’s AWS us-west-1