-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDK - Controlling which modules are captured with Lightweight components
All func_to_* functions now accept the modules_to_capture parameter: List of module names that will be captured (instead of just referencing) during the dependency scan. By default the func.__module__ is captured.
- Loading branch information
Showing
4 changed files
with
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module_level_variable = 10 | ||
|
||
|
||
class ModuleLevelClass: | ||
def class_method(self, x): | ||
return x * module_level_variable | ||
|
||
|
||
def module_func(a: float) -> float: | ||
return a * 5 | ||
|
||
|
||
def module_func_with_deps(a: float, b: float) -> float: | ||
return ModuleLevelClass().class_method(a) + module_func(b) |
4 changes: 4 additions & 0 deletions
4
sdk/python/tests/components/test_data/module2_which_depends_on_module1.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,4 @@ | ||
from .module1 import module_func_with_deps | ||
|
||
def module2_func_with_deps(a: float, b: float) -> float: | ||
return module_func_with_deps(a, b) + 10 |
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