(
command: str, script_source: str, init_script_name: str
)
| 244 | |
| 245 | |
| 246 | def 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 | |
| 264 | def ensure_git_command(command: str) -> None: |
nothing calls this directly
no test coverage detected