Skip to content

✨ Add dag to begin to mint global ids#46

Open
chris-s-friedman wants to merge 29 commits into
mainfrom
feature/cf/id_minting
Open

✨ Add dag to begin to mint global ids#46
chris-s-friedman wants to merge 29 commits into
mainfrom
feature/cf/id_minting

Conversation

@chris-s-friedman

@chris-s-friedman chris-s-friedman commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Add DAG to mint global ids

Adds a dag and associated guide on its use, for minting global ids using airflow

Closes D3B-2873

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality
    to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

running in mwaa

Checklist

Please check all of the items below before merging this pull request. If an
item in the list below does not need to be completed, please indicate the
reason why.

  • I ensured that all tables have proper source and ref definitions
  • I Defined {{ config(schema=[schema name], tags = [list, of, tags]) }} at
    the start of each script
  • I have performed a self-review of my own code
  • I have checked my code and corrected any misspellings
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature
    works
  • My code follows the style guidelines of this project
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have committed any related changes to the PR
  • Run sqlfluff fix on tables that are created or modified in this PR.

@chris-s-friedman
chris-s-friedman marked this pull request as ready for review July 22, 2026 13:05
from airflow.sdk.bases.hook import BaseHook
except (
ImportError
): # Since Airflow 3.1, the BaseHook is in the airflow.sdk.bases.hook module

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while we are currently on airflow 3.0.6, mwaa added airflow v3.2.1 support, so if we upgrade, this will allow for that upgrade. docs on mwaa airflow supported versions

enum=[
"T3JnYW5pemF0aW9uOmNtZjJ3bzlrdDAwMG9rMTAxcHd4cHFmMWQ=",
"T3JnYW5pemF0aW9uOmNsZHN4MzRrbjAwMTRnMGVzY3JndzUzYWQ=",
"org_id_2",

@chris-s-friedman chris-s-friedman Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need the org ID for include dewrangle org here and in values_display

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T3JnYW5pemF0aW9uOmNsZWhibTF4ZjAwZTdpY2VzZjI0d2tlNHk=

},
),
},
tags=["non_program", "id_minting", "dewrangle"],

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there any other tags folks would want for this?

Comment on lines +85 to +86
postgres_conn = BaseHook.get_connection("postgres_prd_svc")
dewrangle_conn = BaseHook.get_connection("dewrangle_api")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are both airflow connections that are maintained within airflow, holding connection secrets

"PROD_DCC_WAREHOUSE_DEWRANGLE_IDS_SCHEMA": "{{ params.globalid_schema_name }}",
"PROD_DCC_WAREHOUSE_DEWRANGLE_IDS_TABLE": "{{ params.globalid_table_name }}",
"DCC_WAREHOUSE_HOST": postgres_conn.host,
"DCC_WAREHOUSE_PORT": str(postgres_conn.port or 5432),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

airflow only allows passing environment variables as strings, which is why this is coerced to string and DEWRANGLE_CLIENT_EXECUTION_TIMEOUT is a string.

[connect-to-airflow.md](/Users/friedmanc1/Documents/include-dbt-sandbox/pipeline_docs/guides/connect-to-airflow.md).
2. The DAG `global_id_minting` is available in Airflow.
3. Your source table already exists in the warehouse.
4. You know which warehouse schema and table should receive the minted global

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the target table need to already exist? Or does this create them as well

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, updating to reflect that it doesn't nee to exist

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see here

@HuangXiaoyan0106

Copy link
Copy Markdown

I left the comments, but otherwise, it looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants