namkwonwoo commited on
Commit
d3ff045
·
1 Parent(s): 2c1110b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,12 +43,12 @@ def get_csv_file(csv_docs):
43
  csv_doc = csv_loader.load()
44
  return csv_doc
45
 
46
- def get_json_file(json_docs):
47
  temp_dir = tempfile.TemporaryDirectory()
48
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
49
  with open(temp_filepath, "wb") as f:
50
  f.write(json_docs.getvalue())
51
- json_loader = JSONLoader(temp_filepath)
52
  json_doc = json_loader.load()
53
  return json_doc
54
 
 
43
  csv_doc = csv_loader.load()
44
  return csv_doc
45
 
46
+ def get_json_file(json_docs, jq_schema=None):
47
  temp_dir = tempfile.TemporaryDirectory()
48
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
49
  with open(temp_filepath, "wb") as f:
50
  f.write(json_docs.getvalue())
51
+ json_loader = JSONLoader(temp_filepath, jq_schema)
52
  json_doc = json_loader.load()
53
  return json_doc
54