Skip to content

Commit cdb171f

Browse files
Abhi SuryawanshiAbhi Suryawanshi
authored andcommitted
Fix: corrected default path handling in extract.py (Issue #2)
1 parent ae242dd commit cdb171f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/etl/extract.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import pandas as pd
22
import os
3-
# TODO (Find & Fix)
43

5-
def extract(path: str = "xyz.csv") -> pd.DataFrame :
4+
# Get the base directory (app/) relative to this file (app/etl/extract.py)
5+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
6+
DEFAULT_DATA_PATH = os.path.join(BASE_DIR, "data.csv")
7+
8+
def extract(path: str = DEFAULT_DATA_PATH) -> pd.DataFrame :
69
"""
710
Extracts data from CSV, Excel, or JSON file.
811

0 commit comments

Comments
 (0)