Skip to content

Commit e13359f

Browse files
Merge pull request #29 from Abhi2006-cloud/fix/extract-only
Fix#5 : Add logic to read CSV file using multiple encodings.. #5
2 parents a5e3cce + 7ac5cf8 commit e13359f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/etl/extract.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def extract(path: str = "xyz.csv") -> pd.DataFrame :
3535
pass
3636
except UnicodeDecodeError:
3737
print(f"Failed to read with encoding '{encoding}'") # Log the encoding that failed
38+
continue
39+
except Exception as e:
40+
print(f"Error reading with encoding '{encoding}': {e}")
41+
continue
3842

3943
if df is None:
4044
raise ValueError(f"Could not read CSV with tried encodings: {encodings}")

0 commit comments

Comments
 (0)