-
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.
[components] Rename build_defs_from_toplevel_components_folder to bui…
…ld_component_defs and make it less magical (#26618) ## Summary & Motivation Does a couple things * Renames the top-level entry point from `build_defs_from_toplevel_components_folder` to `build_component_defs` * Changes the scaffolding to make it a top-level export of `dagster_components` * Removes upwards traversal in the folder hiearchy. Instead requires targeting of the exact directory. This avoids magic and makes errors more explicit ## How I Tested These Changes Generated empty code location from scaffolding and loaded it. ## Changelog BK
- Loading branch information
Showing
10 changed files
with
41 additions
and
31 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...nts/examples/hello_world_deployment/code_locations/hello_world/hello_world/definitions.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
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
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
6 changes: 2 additions & 4 deletions
6
...omponents_tests/code_locations/custom_sling_location/custom_sling_location/definitions.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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
from pathlib import Path | ||
|
||
from dagster._core.definitions.definitions_class import Definitions | ||
from dagster_components.core.component_defs_builder import ( | ||
build_defs_from_toplevel_components_folder, | ||
) | ||
from dagster_components.core.component_defs_builder import build_component_defs | ||
|
||
defs = build_defs_from_toplevel_components_folder(path=Path(__file__).parent) | ||
defs = build_component_defs(code_location_root=Path(__file__).parent.parent) | ||
|
||
if __name__ == "__main__": | ||
Definitions.validate_loadable(defs) |
8 changes: 2 additions & 6 deletions
8
...dg/templates/CODE_LOCATION_NAME_PLACEHOLDER/CODE_LOCATION_NAME_PLACEHOLDER/definitions.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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
from pathlib import Path | ||
|
||
from dagster_components.core.component_defs_builder import ( | ||
build_defs_from_toplevel_components_folder, | ||
) | ||
from dagster_components import build_component_defs | ||
|
||
defs = build_defs_from_toplevel_components_folder( | ||
path=Path(__file__).parent, | ||
) | ||
defs = build_component_defs(code_location_root=Path(__file__).parent.parent) |
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