Skip to content

Commit f69fbea

Browse files
Merge pull request #39 from Abhi2006-cloud/fix/extract-default-path
Fix: corrected default path handling in extract.py (Issue #2)
2 parents ae242dd + d8e0b06 commit f69fbea

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)