-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] - Document non-argument deps for assets [CON-16] (#7962)
* Document non-argument deps * Add test * Remove parenthesis * Fix spacing * Run snapshot * Re-enable pylint in example * Remove resource from example * Run formatting scripts * Resources - Move Overview up * Run snapshot * Trying to fix buildkite * Update non_argument_deps.py * fix lint Co-authored-by: Sandy Ryza <sandy@elementl.com>
- Loading branch information
1 parent
e8f256e
commit a2d7861
Showing
4 changed files
with
79 additions
and
14 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
20 changes: 20 additions & 0 deletions
20
examples/docs_snippets/docs_snippets/concepts/assets/non_argument_deps.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,20 @@ | ||
def execute_query(query): | ||
del query | ||
|
||
|
||
# start_marker | ||
|
||
from dagster import asset | ||
|
||
|
||
@asset | ||
def upstream_asset(): | ||
execute_query("CREATE TABLE sugary_cereals AS SELECT * FROM cereals") | ||
|
||
|
||
@asset(non_argument_deps={"upstream_asset"}) | ||
def downstream_asset(): | ||
execute_query("CREATE TABLE shopping_list AS SELECT * FROM sugary_cereals") | ||
|
||
|
||
# end_marker |
9 changes: 9 additions & 0 deletions
9
...s/docs_snippets/docs_snippets_tests/concepts_tests/assets_tests/test_non_argument_deps.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,9 @@ | ||
from dagster import AssetGroup | ||
from docs_snippets.concepts.assets.non_argument_deps import ( | ||
downstream_asset, | ||
upstream_asset, | ||
) | ||
|
||
|
||
def test_non_argument_deps(): | ||
AssetGroup([upstream_asset, downstream_asset]).materialize() |
a2d7861
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
dagster – ./docs/next
dagster.vercel.app
dagster-git-master-elementl.vercel.app
dagster-elementl.vercel.app
docs.dagster.io
new-docs.dagster.io