-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
30 lines (27 loc) · 962 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import sys
def run(
pipeline_uuid: str,
project_path: str = None,
block_uuid: str = None,
run_sensors: bool = True,
**global_vars,
) -> None:
from mage_ai.data_preparation.executors.executor_factory import ExecutorFactory
from mage_ai.data_preparation.models.pipeline import Pipeline
project_path = os.getcwd() if project_path is None else os.path.abspath(project_path)
sys.path.append(os.path.dirname(project_path))
pipeline = Pipeline(pipeline_uuid, project_path)
if block_uuid is None:
ExecutorFactory.get_pipeline_executor(pipeline).execute(
analyze_outputs=False,
global_vars=global_vars,
run_sensors=run_sensors,
update_status=False,
)
else:
ExecutorFactory.get_block_executor(pipeline, block_uuid).execute(
analyze_outputs=False,
global_vars=global_vars,
update_status=False,
)