Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions examples/pipeline_dsl_text_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,9 @@

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

module_path = Path(__file__).with_name("text_utils.py")
spec = importlib.util.spec_from_file_location("text_utils", module_path)
if spec is None or spec.loader is None:
raise RuntimeError(f"Could not load helper module from {module_path}")

module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module.clean_text(value)
return text_utils.clean_text(value)


@step(
Expand Down
Loading