Update utils.py
Browse files
utils.py
CHANGED
@@ -24,17 +24,12 @@ def read_file_json(file_path):
|
|
24 |
|
25 |
df = None
|
26 |
|
27 |
-
|
28 |
-
if is_ext(file_path, "csv"):
|
29 |
df = pd.read_csv(file_path)
|
30 |
-
|
31 |
-
elif is_ext(file_path, "xls") or is_ext(file_path, "xlsx"):
|
32 |
df = pd.read_excel(file_path)
|
33 |
-
|
34 |
-
elif is_ext(file_path, "json") or is_ext(file_path, "jsonl"):
|
35 |
df = pd.read_json(file_path)
|
36 |
-
print("json")
|
37 |
-
print("222")
|
38 |
|
39 |
return "" if df is None else df.to_json()
|
40 |
|
|
|
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()
|
35 |
|