-
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.
Add: Support for loading multiple modules (#22327)
## Summary & Motivation > Copied the same motivation that was stated back here, where it wasn't proceeded further #12551 It would be nice to load multiple modules using pyproject.toml so users don't have to type out all the modules they want to load using the CLI command. See issue #11439 and discussion #11167. I tried to add the recommendations mentioned here: #12551 (comment) ## How I Tested These Changes I added a new unit test in dagster_tests/cli_tests/test_toml_loading.py ## Changes: ### Add: Support for loading multiple modules from `pyproject.toml` in Dagster (#4bad886) ------------------------------------------------------------------------------------- * Updated documentation to include example of loading multiple modules (`DagsterDevTabs.mdx`) * Added `is_valid_modules_list` function to validate module lists in `pyproject.toml` (`load_target.py`) * Modified `get_origins_from_toml` to support loading multiple modules from `pyproject.toml` (`load_target.py`) * Added new test case `test_load_multiple_modules_from_toml` to verify loading multiple modules (`test_toml_loading.py`) * Created a new TOML test file `multiple_modules.toml` to simulate loading multiple modules (`toml_tests/multiple_modules.toml`)
- Loading branch information
Showing
7 changed files
with
161 additions
and
6 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
2 changes: 2 additions & 0 deletions
2
...les/dagster/dagster_tests/cli_tests/workspace_tests/toml_tests/invalid_empty_modules.toml
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,2 @@ | ||
[tool.dagster] | ||
modules = [] |
8 changes: 8 additions & 0 deletions
8
...ules/dagster/dagster_tests/cli_tests/workspace_tests/toml_tests/invalid_modules_dict.toml
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,8 @@ | ||
[tool.dagster] | ||
modules = [ | ||
{ name = 1 }, | ||
{ name = "foo" }, | ||
{ type = "module" }, | ||
{ type = true }, | ||
{ bar = "foo" }, | ||
] |
6 changes: 6 additions & 0 deletions
6
...ter/dagster_tests/cli_tests/workspace_tests/toml_tests/mixed_modules_and_module_name.toml
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 @@ | ||
[tool.dagster] | ||
module_name = "foo" | ||
modules = [ | ||
{ type = "module", name = "foo" }, | ||
{ type = "module", name = "bar" } | ||
] |
5 changes: 5 additions & 0 deletions
5
..._modules/dagster/dagster_tests/cli_tests/workspace_tests/toml_tests/multiple_modules.toml
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,5 @@ | ||
[tool.dagster] | ||
modules = [ | ||
{ type = "module", name = "foo" }, | ||
{ type = "module", name = "bar" } | ||
] ## names of project's Python modules |
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
2f0664d
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-4zmbold61-elementl.vercel.app
https://master.dagster.dagster-docs.io
Built with commit 2f0664d.
This pull request is being automatically deployed with vercel-action