Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/etl/extract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pandas as pd
import os
# TODO (Find & Fix)
from typing import Optional

def extract(path: str = "xyz.csv") -> pd.DataFrame :
"""
Expand Down Expand Up @@ -51,4 +50,4 @@ def extract(path: str = "xyz.csv") -> pd.DataFrame :
except pd.errors.ParserError as e:
raise ValueError(f"❌ Error parsing CSV: {e}")
except Exception as e:
raise ValueError(f"❌ Unexpected error reading file: {e}")
raise ValueError(f"❌ Unexpected error reading file: {e}")
3 changes: 1 addition & 2 deletions app/etl/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import sqlite3
import os
# TODO (Find & Fix)
from typing import Optional

def load(df: pd.DataFrame, db_path: str = "etl_data.db", table_name: str = "processed_data"):
"""
Expand Down Expand Up @@ -68,4 +67,4 @@ def load(df: pd.DataFrame, db_path: str = "etl_data.db", table_name: str = "proc
conn.rollback()
finally:
if conn:
conn.close()
conn.close()
4 changes: 1 addition & 3 deletions app/etl/transform.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import pandas as pd
from datetime import datetime
# TODO (Find & Fix)
from typing import Optional

def transform(df: pd.DataFrame) -> pd.DataFrame:
"""
Expand Down Expand Up @@ -51,4 +49,4 @@ def transform(df: pd.DataFrame) -> pd.DataFrame:
pass

# TODO (Find & Fix): Text columns are not cleaned (strip, lowercase)
return df_transformed
return df_transformed
Loading