-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Add more explanation for FilePathMapping for code references (#…
…23385) ## Summary Adds .rst entry and link to apidoc for file path mapping objects, since this is probably the most confusing part of mapping to source control. ## Test Plan Vercel preview. --------- Co-authored-by: Erin Cochran <[email protected]>
- Loading branch information
1 parent
bea0af6
commit 07b5902
Showing
8 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,52 @@ | ||
from pathlib import Path | ||
|
||
from dagster import ( | ||
Definitions, | ||
ScheduleDefinition, | ||
define_asset_job, | ||
graph_asset, | ||
link_code_references_to_git, | ||
load_assets_from_package_module, | ||
op, | ||
with_source_code_references, | ||
) | ||
from dagster._core.definitions.metadata.source_code import AnchorBasedFilePathMapping | ||
|
||
from . import assets | ||
|
||
daily_refresh_schedule = ScheduleDefinition( | ||
job=define_asset_job(name="all_assets_job"), cron_schedule="0 0 * * *" | ||
) | ||
|
||
|
||
@op | ||
def foo_op(): | ||
return 5 | ||
|
||
|
||
@graph_asset | ||
def my_asset(): | ||
return foo_op() | ||
|
||
|
||
my_assets = with_source_code_references( | ||
[ | ||
my_asset, | ||
*load_assets_from_package_module(assets), | ||
] | ||
) | ||
|
||
my_assets = link_code_references_to_git( | ||
assets_defs=my_assets, | ||
git_url="https://github.com/dagster-io/dagster/", | ||
git_branch="master", | ||
file_path_mapping=AnchorBasedFilePathMapping( | ||
local_file_anchor=Path(__file__).parent, | ||
file_anchor_path_in_repository="examples/quickstart_etl/quickstart_etl/", | ||
), | ||
) | ||
|
||
defs = Definitions( | ||
assets=load_assets_from_package_module(assets), schedules=[daily_refresh_schedule] | ||
assets=my_assets, | ||
schedules=[daily_refresh_schedule], | ||
) |
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
07b5902
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.
Deploy preview for dagster-docs ready!
✅ Preview
https://dagster-docs-hgq9lftvp-elementl.vercel.app
https://master.dagster.dagster-docs.io
Built with commit 07b5902.
This pull request is being automatically deployed with vercel-action