forked from noklam/miniKedro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_v2.py
34 lines (29 loc) · 1.16 KB
/
run_v2.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
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.v2 import ConfigLoader
config_loader = ConfigLoader("src/minikedro/v2/config.yml")
companies = pd.read_csv(config_loader["companies"]["filepath"])
reviews = pd.read_csv(config_loader["reviews"]["filepath"])
shuttles = pd.read_excel(config_loader["shuttles"]["filepath"])
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
)