forked from noklam/miniKedro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_v3.py
38 lines (31 loc) · 1.2 KB
/
run_v3.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
31
32
33
34
35
36
37
38
from minikedro.v3 import DataCatalog
if __name__ == "__main__":
print("Start Pipeline")
from minikedro.pipelines.data_processing.nodes import (
create_model_input_table,
preprocess_companies,
preprocess_shuttles,
)
from rich.logging import RichHandler
import logging
import pandas as pd
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
handlers=[RichHandler()],
)
logger = logging.getLogger("minikedro")
from minikedro.v3 import ConfigLoader, DataCatalog
config_loader = ConfigLoader("src/minikedro/v3/config.yml")
data_catalog = DataCatalog(config_loader.data)
companies = data_catalog.load("companies")
reviews = data_catalog.load("reviews")
shuttles = data_catalog.load("shuttles")
logger.info("Running preprocess_companies")
processed_companies = preprocess_companies(companies)
logger.info("Running preprocess_shuttles")
processed_shuttles = preprocess_shuttles(shuttles)
logger.info("Running create_model_input_table")
model_input_table = create_model_input_table(
processed_shuttles, processed_companies, reviews
)