Skip to content

Commit 9b45b14

Browse files
authored
Use direct text_utils import in pipeline DSL example (#1047)
* Plan: address text helper import approach * Use direct text_utils import in pipeline DSL example
1 parent 97a5c43 commit 9b45b14

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

examples/pipeline_dsl_text_pipeline.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,9 @@
3333

3434
def normalize_text(value: str) -> str:
3535
"""Small helper intentionally kept outside the step for codegen extraction."""
36-
import importlib.util
37-
from pathlib import Path
36+
import text_utils
3837

39-
module_path = Path(__file__).with_name("text_utils.py")
40-
spec = importlib.util.spec_from_file_location("text_utils", module_path)
41-
if spec is None or spec.loader is None:
42-
raise RuntimeError(f"Could not load helper module from {module_path}")
43-
44-
module = importlib.util.module_from_spec(spec)
45-
spec.loader.exec_module(module)
46-
return module.clean_text(value)
38+
return text_utils.clean_text(value)
4739

4840

4941
@step(

0 commit comments

Comments
 (0)