-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[components][rfc]
@component_loader
decorator
- Loading branch information
1 parent
82497f2
commit a602eb7
Showing
6 changed files
with
106 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ts_tests/code_locations/python_script_location/components/script_python_decl/component.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from dagster_components import AssetAttributesModel, ComponentLoadContext | ||
from dagster_components.core.component import component_loader | ||
from dagster_components.lib import PipesSubprocessScriptCollection | ||
from dagster_components.lib.pipes_subprocess_script_collection import ( | ||
PipesSubprocessScriptCollectionParams, | ||
PipesSubprocessScriptParams, | ||
) | ||
|
||
|
||
@component_loader | ||
def load(context: ComponentLoadContext) -> PipesSubprocessScriptCollection: | ||
params = PipesSubprocessScriptCollectionParams( | ||
scripts=[ | ||
PipesSubprocessScriptParams( | ||
path="cool_script.py", | ||
assets=[ | ||
AssetAttributesModel( | ||
key="cool_script", | ||
automation_condition="{{ automation_condition.eager() }}", | ||
), | ||
], | ||
), | ||
] | ||
) | ||
return PipesSubprocessScriptCollection.load(params=params, context=context) |
6 changes: 6 additions & 0 deletions
6
..._tests/code_locations/python_script_location/components/script_python_decl/cool_script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def do_thing() -> None: | ||
pass | ||
|
||
|
||
if __name__ == "__main__": | ||
do_thing() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters