bstraehle commited on
Commit
d96270e
·
verified ·
1 Parent(s): c71216f

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +3 -3
utils.py CHANGED
@@ -24,11 +24,11 @@ def read_file_json(file_path):
24
 
25
  df = None
26
 
27
- if ext == ".csv":
28
  df = pd.read_csv(file_path)
29
- elif ext in (".xls", ".xlsx"):
30
  df = pd.read_excel(file_path)
31
- elif ext in (".json", ".jsonl"):
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()