Skip to content

Commit

Permalink
[components] Move dagster_components.lib components to top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
smackesey committed Feb 27, 2025
1 parent 12c4625 commit 1291ed3
Show file tree
Hide file tree
Showing 54 changed files with 180 additions and 194 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dagster_components.lib import SlingReplicationCollectionComponent
from dagster_components import SlingReplicationCollectionComponent


class CustomSubclass(SlingReplicationCollectionComponent): ...
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections.abc import Mapping
from typing import Any

from dagster_components.lib import SlingReplicationCollectionComponent
from dagster_components import SlingReplicationCollectionComponent

import dagster as dg

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Iterator

from dagster_components.lib import SlingReplicationCollectionComponent
from dagster_components import SlingReplicationCollectionComponent
from dagster_sling import SlingResource

import dagster as dg
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
dg list component-type

Using /.../my-existing-project/.venv/bin/dagster-components
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ Component Type ┃ Summary ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ dagster_components.lib.DefinitionsComponent │ Wraps an arbitrary │
│ │ set of Dagster │
│ │ definitions. │
│ dagster_components.lib.PipesSubprocessScriptCollectionComponent │ Assets that wrap │
│ │ Python scripts │
│ │ executed with │
│ │ Dagster's │
│ │ PipesSubprocessClie… │
└─────────────────────────────────────────────────────────────────┴──────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Component Type ┃ Summary ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ dagster_components.DefinitionsComponent │ Wraps an arbitrary set │
│ │ of Dagster definitions. │
│ dagster_components.PipesSubprocessScriptCollectionComponent │ Assets that wrap Python │
│ │ scripts executed with │
│ │ Dagster's │
│ │ PipesSubprocessClient. │
└─────────────────────────────────────────────────────────────┴──────────────────────────┘
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: dagster_components.lib.SlingReplicationCollectionComponent
type: dagster_components.SlingReplicationCollectionComponent

attributes:
replications:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
dg list component-type

Using /.../jaffle-platform/.venv/bin/dagster-components
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ Component Type ┃ Summary ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ dagster_components.lib.DbtProjectComponent │ Expose a DBT project │
│ │ to Dagster as a set │
│ │ of assets. │
│ dagster_components.lib.DefinitionsComponent │ Wraps an arbitrary │
│ │ set of Dagster │
│ │ definitions. │
│ dagster_components.lib.PipesSubprocessScriptCollectionComponent │ Assets that wrap │
│ │ Python scripts │
│ │ executed with │
│ │ Dagster's │
│ │ PipesSubprocessClie… │
│ dagster_components.lib.SlingReplicationCollectionComponent │ Expose one or more │
│ │ Sling replications │
│ │ to Dagster as │
│ │ assets. │
└─────────────────────────────────────────────────────────────────┴──────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Component Type ┃ Summary ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ dagster_components.DbtProjectComponent │ Expose a DBT project to │
│ │ Dagster as a set of │
│ │ assets. │
│ dagster_components.DefinitionsComponent │ Wraps an arbitrary set │
│ │ of Dagster definitions. │
│ dagster_components.PipesSubprocessScriptCollectionComponent │ Assets that wrap Python │
│ │ scripts executed with │
│ │ Dagster's │
│ │ PipesSubprocessClient. │
│ dagster_components.SlingReplicationCollectionComponent │ Expose one or more Sling │
│ │ replications to Dagster │
│ │ as assets. │
└─────────────────────────────────────────────────────────────┴──────────────────────────┘
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dg scaffold component dagster_components.lib.DbtProjectComponent jdbt --project-path dbt/jdbt
dg scaffold component dagster_components.DbtProjectComponent jdbt --project-path dbt/jdbt

Creating a Dagster component instance folder at /.../jaffle-platform/jaffle_platform/defs/jdbt.
Using /.../jaffle-platform/.venv/bin/dagster-components
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: dagster_components.lib.DbtProjectComponent
type: dagster_components.DbtProjectComponent

attributes:
dbt:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: dagster_components.lib.DbtProjectComponent
type: dagster_components.DbtProjectComponent

attributes:
dbt:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
dg list component-type

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ Component Type ┃ Summary ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ dagster_components.lib.DefinitionsComponent │ Wraps an arbitrary │
│ │ set of Dagster │
│ │ definitions. │
│ dagster_components.lib.PipesSubprocessScriptCollectionComponent │ Assets that wrap │
│ │ Python scripts │
│ │ executed with │
│ │ Dagster's │
│ │ PipesSubprocessClie… │
└─────────────────────────────────────────────────────────────────┴──────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Component Type ┃ Summary ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ dagster_components.DefinitionsComponent │ Wraps an arbitrary set │
│ │ of Dagster definitions. │
│ dagster_components.PipesSubprocessScriptCollectionComponent │ Assets that wrap Python │
│ │ scripts executed with │
│ │ Dagster's │
│ │ PipesSubprocessClient. │
└─────────────────────────────────────────────────────────────┴──────────────────────────┘
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
dg list component-type

Using /.../jaffle-platform/.venv/bin/dagster-components
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ Component Type ┃ Summary ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ dagster_components.lib.DefinitionsComponent │ Wraps an arbitrary │
│ │ set of Dagster │
│ │ definitions. │
│ dagster_components.lib.PipesSubprocessScriptCollectionComponent │ Assets that wrap │
│ │ Python scripts │
│ │ executed with │
│ │ Dagster's │
│ │ PipesSubprocessClie… │
│ dagster_components.lib.SlingReplicationCollectionComponent │ Expose one or more │
│ │ Sling replications │
│ │ to Dagster as │
│ │ assets. │
└─────────────────────────────────────────────────────────────────┴──────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Component Type ┃ Summary ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ dagster_components.DefinitionsComponent │ Wraps an arbitrary set │
│ │ of Dagster definitions. │
│ dagster_components.PipesSubprocessScriptCollectionComponent │ Assets that wrap Python │
│ │ scripts executed with │
│ │ Dagster's │
│ │ PipesSubprocessClient. │
│ dagster_components.SlingReplicationCollectionComponent │ Expose one or more Sling │
│ │ replications to Dagster │
│ │ as assets. │
└─────────────────────────────────────────────────────────────┴──────────────────────────┘
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dg scaffold component 'dagster_components.lib.SlingReplicationCollectionComponent' ingest_files
dg scaffold component 'dagster_components.SlingReplicationCollectionComponent' ingest_files

Creating a Dagster component instance folder at /.../jaffle-platform/jaffle_platform/defs/ingest_files.
Using /.../jaffle-platform/.venv/bin/dagster-components
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dg scaffold component 'dagster_components.lib.DefinitionsComponent' elt-definitions
dg scaffold component 'dagster_components.DefinitionsComponent' elt-definitions

Using /.../my-existing-project/.venv/bin/dagster-components
Creating a Dagster component instance folder at /.../my-existing-project/my_existing_project/defs/elt-definitions.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: dagster_components.lib.DefinitionsComponent
type: dagster_components.DefinitionsComponent

attributes:
definitions_path: definitions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dagster_components import ComponentLoadContext, component
from dagster_components.lib import DbtProjectComponent
from dagster_components import ComponentLoadContext, DbtProjectComponent, component
from dagster_dbt import DagsterDbtTranslator, DbtCliResource


Expand Down
Loading

0 comments on commit 1291ed3

Please sign in to comment.