Himanshu Khairajani 79c3d55128
Fix #21679: Added metadata ingest-dbt CLI Command for Direct DBT Artifacts Ingestion (#21680)
* metadata dbt

* fix:
 - default path to current directory
 - addional warning and exception handling for missing metadata config vars

* test: add unit tests for DBT Ingestion CLI

* refactor

* PR review:
 - using Pydantic to parse and validate the openmetadata config in dbt's .yml
 - extended test-cases
 - giving user more configuration options for ingestion

* py refactoring

* add: dbt-auto ingest docs

* Improvements:
 - using environement variables for loading sensitve variables
 - added docs for auto dbt-ingestion for dbt-core
 - more test cases

* fix:
 - test case for reading JWT token inside the the method

* refactor: py code formatting

* refactor: py formatting

* ingest-dbt docs updated

* refined test cases

* Chore:
 - sonar vulnerability issue review
 - using existing URL class for host validation

---------

Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com>
2025-06-19 17:57:10 +05:30

62 lines
1.9 KiB
YAML

# Name your project! Project names should contain only lowercase characters
# and underscores. A good package name should reflect your organization's
# name or the intended use of these models
name: 'jaffle_shop'
version: '1.0.0'
config-version: 2
# This setting configures which "profile" dbt uses for this project.
profile: 'jaffle_shop'
# These configurations specify where dbt should look for different types of files.
# The `model-paths` config, for example, states that models in this project can be
# found in the "models/" directory. You probably won't need to change these!
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"
# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models
# In this example config, we tell dbt to build all models in the example/
# directory as views. These settings can be overridden in the individual model
# files using the `{{ config(...) }}` macro.
models:
jaffle_shop:
example:
+materialized: table
vars:
# Required OpenMetadata configuration for metadata ingest-dbt command
openmetadata_host_port: "http://test-server:port/endpoint"
openmetadata_jwt_token: ${OPENMETADATA_JWT_TOKEN}
openmetadata_service_name: "test_service"
# Optional OpenMetadata DBT source configuration
# DBT behavior settings
openmetadata_dbt_update_descriptions: true
openmetadata_dbt_update_owners: false
openmetadata_dbt_classification_name: "dbtTags"
# Filter patterns - standardized dict format with includes/excludes
openmetadata_database_filter_pattern:
includes: ["dbt_test_*"]
excludes: ["temp_*", "test_*"]
openmetadata_table_filter_pattern:
includes: [".*"]
excludes: ["temp_.*", "tmp_.*"]
quoting:
database: false
schema: false
identifier: false