Update utils.py
Browse files
utils.py
CHANGED
@@ -24,11 +24,11 @@ def read_file_json(file_path):
|
|
24 |
|
25 |
df = None
|
26 |
|
27 |
-
if
|
28 |
df = pd.read_csv(file_path)
|
29 |
-
elif
|
30 |
df = pd.read_excel(file_path)
|
31 |
-
elif
|
32 |
df = pd.read_json(file_path)
|
33 |
|
34 |
return "" if df is None else df.to_json()
|
|
|
24 |
|
25 |
df = None
|
26 |
|
27 |
+
if is_ext(file_path, "csv"):
|
28 |
df = pd.read_csv(file_path)
|
29 |
+
elif is_ext(file_path, "xls") or is_ext(file_path, "xlsx"):
|
30 |
df = pd.read_excel(file_path)
|
31 |
+
elif is_ext(file_path, "json") or is_ext(file_path, "jsonl"):
|
32 |
df = pd.read_json(file_path)
|
33 |
|
34 |
return "" if df is None else df.to_json()
|