Get pipeline input and parameter Args: source_file_path (str): The pipeline source code path class_name (str): The pipeline class name
(
source_file_path: str,
class_name: str,
)
| 394 | |
| 395 | |
| 396 | def get_pipeline_input_parameters( |
| 397 | source_file_path: str, |
| 398 | class_name: str, |
| 399 | ): |
| 400 | """Get pipeline input and parameter |
| 401 | |
| 402 | Args: |
| 403 | source_file_path (str): The pipeline source code path |
| 404 | class_name (str): The pipeline class name |
| 405 | """ |
| 406 | with open(source_file_path, 'rb') as f: |
| 407 | src = f.read() |
| 408 | analyzer = AnalysisSourceFileRegisterModules(source_file_path, |
| 409 | class_name) |
| 410 | analyzer.visit( |
| 411 | ast.parse( |
| 412 | src, |
| 413 | filename=source_file_path, |
| 414 | # python3.7 no type_comments parameter . |
| 415 | # type_comments=True |
| 416 | )) |
| 417 | clz = PipelineClassAnalyzer() |
| 418 | clz.visit(analyzer.class_define) |
| 419 | input, pipeline_parameters = clz.get_input_parameters() |
| 420 | # remove the first input parameter, the input is defined by task. |
| 421 | return input, pipeline_parameters |
| 422 | |
| 423 | |
| 424 | meta_type_schema_map = { |
no test coverage detected
searching dependent graphs…