-
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.
pass on partitions page for assets (#8355)
- Loading branch information
Showing
3 changed files
with
139 additions
and
55 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
31 changes: 31 additions & 0 deletions
31
...ocs_snippets/docs_snippets/concepts/partitions_schedules_sensors/partitioned_asset_job.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,31 @@ | ||
from dagster import ( | ||
AssetSelection, | ||
HourlyPartitionsDefinition, | ||
asset, | ||
define_asset_job, | ||
repository, | ||
) | ||
|
||
hourly_partitions_def = HourlyPartitionsDefinition(start_date="2022-05-31-00:00") | ||
|
||
|
||
@asset(partitions_def=hourly_partitions_def) | ||
def asset1(): | ||
... | ||
|
||
|
||
@asset(partitions_def=hourly_partitions_def) | ||
def asset2(): | ||
... | ||
|
||
|
||
partitioned_asset_job = define_asset_job( | ||
name="asset_1_and_2_job", | ||
selection=AssetSelection.assets(asset1, asset2), | ||
partitions_def=hourly_partitions_def, | ||
) | ||
|
||
|
||
@repository | ||
def repo(): | ||
return [asset1, asset2, partitioned_asset_job] |
7 changes: 7 additions & 0 deletions
7
...ets_tests/concepts_tests/partitions_schedules_sensors_tests/test_partitioned_asset_job.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,7 @@ | ||
from docs_snippets.concepts.partitions_schedules_sensors.partitioned_asset_job import ( | ||
repo, | ||
) | ||
|
||
|
||
def test(): | ||
assert repo.get_job("asset_1_and_2_job") |
d679440
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
docs.dagster.io
dagster-git-master-elementl.vercel.app
new-docs.dagster.io
dagster.vercel.app
dagster-elementl.vercel.app