Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 0715613

Browse files
docs - dagster asset prefix key (#658)
* docs - dagster asset prefix key * correct field name * added example links * applied formatting
1 parent da2fb1b commit 0715613

File tree

6 files changed

+148
-2
lines changed

6 files changed

+148
-2
lines changed

content/v1.11.x/connectors/pipeline/dagster/index.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ For a complete guide on managing secrets in hybrid setups, see the [Hybrid Inges
8282
- Click on the "Create a New API Key" button.
8383
- Give your API key a name and click on the "Create API Key" button.
8484
- Copy the generated API key to your clipboard and paste it in the field.
85+
- **Strip Asset Key Prefix Length**: Number of leading segments to remove from asset key paths before resolving to tables. Dagster asset keys are path-like identifiers (e.g., `["project", "environment", "schema", "table"]`).
86+
OpenMetadata matches these to tables using `database.schema.table` or `schema.table` format.
87+
If your asset keys include additional prefix segments (project, environment, etc.), use this setting to strip them.
88+
For example, setting value to `2` on asset key `["project", "env", "schema", "table"]` results in `schema.table`.
89+
Default: `0` (no stripping). See [detailed examples](#lineage) in the Lineage section below.
8590

8691
{% /extraContent %}
8792

@@ -142,6 +147,53 @@ def customer_orders():
142147
| `["schema", "table"]` | Schema and table only |
143148
| `["table"]` | Table name only |
144149

150+
**Using stripAssetKeyPrefixLength for Asset Keys with Prefixes**
151+
152+
If your asset keys include additional prefix segments (e.g., project name, environment), use the `stripAssetKeyPrefixLength` configuration to remove them before matching to tables:
153+
154+
**Example 1: Stripping Environment Prefix**
155+
156+
```python
157+
# Your Dagster asset keys include environment prefix
158+
@asset(key=["prod", "analytics_db", "public", "customers"])
159+
def customers():
160+
...
161+
162+
@asset(
163+
key=["prod", "analytics_db", "public", "orders"],
164+
deps=[customers]
165+
)
166+
def orders():
167+
...
168+
```
169+
170+
**Configuration:**
171+
```yaml
172+
sourceConfig:
173+
config:
174+
stripAssetKeyPrefixLength: 1 # Remove the first segment ("prod")
175+
```
176+
177+
**Result:** Asset keys become `["analytics_db", "public", "customers"]` and `["analytics_db", "public", "orders"]`, which match the table format `database.schema.table`.
178+
179+
**Example 2: Stripping Multiple Prefixes**
180+
181+
```python
182+
# Asset keys with project and environment prefixes
183+
@asset(key=["my_project", "staging", "warehouse", "raw", "users"])
184+
def users():
185+
...
186+
```
187+
188+
**Configuration:**
189+
```yaml
190+
sourceConfig:
191+
config:
192+
stripAssetKeyPrefixLength: 2 # Remove first two segments ("my_project", "staging")
193+
```
194+
195+
**Result:** Asset key becomes `["warehouse", "raw", "users"]`, matching `warehouse.raw.users` in OpenMetadata.
196+
145197
**2. Assets Include Table Metadata in Materializations**
146198

147199
If your assets don't use database-style keys, you can still get lineage by including table metadata when materializing:

content/v1.11.x/connectors/pipeline/dagster/yaml.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,26 @@ This is a sample config for Dagster:
7575
**timeout** : Connection Time Limit Between OM and Dagster Graphql API in second
7676
{% /codeInfo %}
7777

78+
{% codeInfo srNumber=4 %}
79+
80+
**stripAssetKeyPrefixLength**: Number of leading segments to remove from asset key paths before resolving to tables.
81+
82+
Dagster asset keys are path-like identifiers represented as arrays of strings (e.g., `["project", "environment", "schema", "table"]`). When OpenMetadata ingests Dagster pipelines, it tries to match these asset keys to table entities using the standard format: `database.schema.table` or `schema.table`.
83+
84+
If your Dagster asset keys include additional prefix segments beyond the database/schema/table hierarchy, use this setting to strip those prefixes. For example:
85+
- Asset key: `["project", "environment", "schema", "table"]`
86+
- Set value to `2` to strip `project` and `environment`
87+
- Result: `schema.table` (matches OpenMetadata table entities)
88+
89+
Common use cases include stripping project/workspace identifiers, environment names (dev/staging/prod), or storage bucket/container prefixes.
90+
91+
Default value is `0` (no stripping).
92+
93+
{% /codeInfo %}
94+
7895
#### Source Configuration - Lineage
7996

80-
{% codeInfo srNumber=4 %}
97+
{% codeInfo srNumber=5 %}
8198

8299
**lineageInformation**: Configure lineage extraction settings.
83100

@@ -120,6 +137,9 @@ source:
120137
# timeout: 1000
121138
```
122139
```yaml {% srNumber=4 %}
140+
# stripAssetKeyPrefixLength: 0
141+
```
142+
```yaml {% srNumber=5 %}
123143
sourceConfig:
124144
config:
125145
type: PipelineMetadata

content/v1.11.x/main-concepts/metadata-standard/schemas/entity/services/connections/pipeline/dagsterConnection.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ slug: /main-concepts/metadata-standard/schemas/entity/services/connections/pipel
1313
- **`host`** *(string)*: URL to the Dagster instance.
1414
- **`token`** *(string)*: To Connect to Dagster Cloud.
1515
- **`timeout`** *(integer)*: Connection Time Limit Between OM and Dagster Graphql API in second. Default: `1000`.
16+
- **`stripAssetKeyPrefixLength`** *(integer)*: Number of leading segments to remove from asset key paths before resolving to tables. Dagster asset keys are path-like identifiers (e.g., `["project", "environment", "schema", "table"]`). Use this setting to strip prefix segments beyond the database/schema/table hierarchy. Default: `0`.
1617
- **`pipelineFilterPattern`**: Regex exclude pipelines. Refer to *../../../../type/filterPattern.json#/definitions/filterPattern*.
1718
- **`supportsMetadataExtraction`**: Refer to *../connectionBasicType.json#/definitions/supportsMetadataExtraction*.
1819
## Definitions

content/v1.12.x-SNAPSHOT/connectors/pipeline/dagster/index.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ For a complete guide on managing secrets in hybrid setups, see the [Hybrid Inges
8282
- Click on the "Create a New API Key" button.
8383
- Give your API key a name and click on the "Create API Key" button.
8484
- Copy the generated API key to your clipboard and paste it in the field.
85+
- **Strip Asset Key Prefix Length**: Number of leading segments to remove from asset key paths before resolving to tables. Dagster asset keys are path-like identifiers (e.g., `["project", "environment", "schema", "table"]`).
86+
OpenMetadata matches these to tables using `database.schema.table` or `schema.table` format.
87+
If your asset keys include additional prefix segments (project, environment, etc.), use this setting to strip them.
88+
For example, setting value to `2` on asset key `["project", "env", "schema", "table"]` results in `schema.table`.
89+
Default: `0` (no stripping). See [detailed examples](#lineage) in the Lineage section below.
8590

8691
{% /extraContent %}
8792

@@ -142,6 +147,53 @@ def customer_orders():
142147
| `["schema", "table"]` | Schema and table only |
143148
| `["table"]` | Table name only |
144149

150+
**Using stripAssetKeyPrefixLength for Asset Keys with Prefixes**
151+
152+
If your asset keys include additional prefix segments (e.g., project name, environment), use the `stripAssetKeyPrefixLength` configuration to remove them before matching to tables:
153+
154+
**Example 1: Stripping Environment Prefix**
155+
156+
```python
157+
# Your Dagster asset keys include environment prefix
158+
@asset(key=["prod", "analytics_db", "public", "customers"])
159+
def customers():
160+
...
161+
162+
@asset(
163+
key=["prod", "analytics_db", "public", "orders"],
164+
deps=[customers]
165+
)
166+
def orders():
167+
...
168+
```
169+
170+
**Configuration:**
171+
```yaml
172+
sourceConfig:
173+
config:
174+
stripAssetKeyPrefixLength: 1 # Remove the first segment ("prod")
175+
```
176+
177+
**Result:** Asset keys become `["analytics_db", "public", "customers"]` and `["analytics_db", "public", "orders"]`, which match the table format `database.schema.table`.
178+
179+
**Example 2: Stripping Multiple Prefixes**
180+
181+
```python
182+
# Asset keys with project and environment prefixes
183+
@asset(key=["my_project", "staging", "warehouse", "raw", "users"])
184+
def users():
185+
...
186+
```
187+
188+
**Configuration:**
189+
```yaml
190+
sourceConfig:
191+
config:
192+
stripAssetKeyPrefixLength: 2 # Remove first two segments ("my_project", "staging")
193+
```
194+
195+
**Result:** Asset key becomes `["warehouse", "raw", "users"]`, matching `warehouse.raw.users` in OpenMetadata.
196+
145197
**2. Assets Include Table Metadata in Materializations**
146198

147199
If your assets don't use database-style keys, you can still get lineage by including table metadata when materializing:

content/v1.12.x-SNAPSHOT/connectors/pipeline/dagster/yaml.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,26 @@ This is a sample config for Dagster:
7575
**timeout** : Connection Time Limit Between OM and Dagster Graphql API in second
7676
{% /codeInfo %}
7777

78+
{% codeInfo srNumber=4 %}
79+
80+
**stripAssetKeyPrefixLength**: Number of leading segments to remove from asset key paths before resolving to tables.
81+
82+
Dagster asset keys are path-like identifiers represented as arrays of strings (e.g., `["project", "environment", "schema", "table"]`). When OpenMetadata ingests Dagster pipelines, it tries to match these asset keys to table entities using the standard format: `database.schema.table` or `schema.table`.
83+
84+
If your Dagster asset keys include additional prefix segments beyond the database/schema/table hierarchy, use this setting to strip those prefixes. For example:
85+
- Asset key: `["project", "environment", "schema", "table"]`
86+
- Set value to `2` to strip `project` and `environment`
87+
- Result: `schema.table` (matches OpenMetadata table entities)
88+
89+
Common use cases include stripping project/workspace identifiers, environment names (dev/staging/prod), or storage bucket/container prefixes.
90+
91+
Default value is `0` (no stripping).
92+
93+
{% /codeInfo %}
94+
7895
#### Source Configuration - Lineage
7996

80-
{% codeInfo srNumber=4 %}
97+
{% codeInfo srNumber=5 %}
8198

8299
**lineageInformation**: Configure lineage extraction settings.
83100

@@ -120,6 +137,9 @@ source:
120137
# timeout: 1000
121138
```
122139
```yaml {% srNumber=4 %}
140+
# stripAssetKeyPrefixLength: 0
141+
```
142+
```yaml {% srNumber=5 %}
123143
sourceConfig:
124144
config:
125145
type: PipelineMetadata

content/v1.12.x-SNAPSHOT/main-concepts/metadata-standard/schemas/entity/services/connections/pipeline/dagsterConnection.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ slug: /main-concepts/metadata-standard/schemas/entity/services/connections/pipel
1313
- **`host`** *(string)*: URL to the Dagster instance.
1414
- **`token`** *(string)*: To Connect to Dagster Cloud.
1515
- **`timeout`** *(integer)*: Connection Time Limit Between OM and Dagster Graphql API in second. Default: `1000`.
16+
- **`stripAssetKeyPrefixLength`** *(integer)*: Number of leading segments to remove from asset key paths before resolving to tables. Dagster asset keys are path-like identifiers (e.g., `["project", "environment", "schema", "table"]`). Use this setting to strip prefix segments beyond the database/schema/table hierarchy. Default: `0`.
1617
- **`pipelineFilterPattern`**: Regex exclude pipelines. Refer to *../../../../type/filterPattern.json#/definitions/filterPattern*.
1718
- **`supportsMetadataExtraction`**: Refer to *../connectionBasicType.json#/definitions/supportsMetadataExtraction*.
1819
## Definitions

0 commit comments

Comments
 (0)