MCPcopy
hub / github.com/dlt-hub/dlt / parse_init_script

Function parse_init_script

dlt/_workspace/cli/utils.py:246–261  ·  view source on GitHub ↗
(
    command: str, script_source: str, init_script_name: str
)

Source from the content-addressed store, hash-verified

244
245
246def parse_init_script(
247 command: str, script_source: str, init_script_name: str
248) -> PipelineScriptVisitor:
249 # parse the script first
250 tree = ast.parse(source=script_source)
251 set_ast_parents(tree)
252 visitor = PipelineScriptVisitor(script_source)
253 visitor.visit_passes(tree)
254 if len(visitor.mod_aliases) == 0:
255 raise CliCommandInnerException(
256 command,
257 f"The pipeline script {init_script_name} does not import dlt and does not seem to run"
258 " any pipelines",
259 )
260
261 return visitor
262
263
264def ensure_git_command(command: str) -> None:

Callers

nothing calls this directly

Calls 5

visit_passesMethod · 0.95
set_ast_parentsFunction · 0.90
parseMethod · 0.80

Tested by

no test coverage detected