Update app.py
Browse files
app.py
CHANGED
|
@@ -50,12 +50,12 @@ def get_csv_file(csv_docs):
|
|
| 50 |
def get_json_file(json_docs):
|
| 51 |
temp_dir = tempfile.TemporaryDirectory()
|
| 52 |
temp_filepath=os.path.join(temp_dir.name, json_docs.name)
|
| 53 |
-
with open(temp_filepath,"
|
| 54 |
-
f.
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
json_loader=JSONLoader(
|
| 60 |
temp_filepath=os.path.join(temp_dir.name, json_docs.name),
|
| 61 |
jq_schema='.',
|
|
|
|
| 50 |
def get_json_file(json_docs):
|
| 51 |
temp_dir = tempfile.TemporaryDirectory()
|
| 52 |
temp_filepath=os.path.join(temp_dir.name, json_docs.name)
|
| 53 |
+
with open(temp_filepath,"r") as f:
|
| 54 |
+
s=f.read(json_docs.getvalue())
|
| 55 |
+
s=s.replace('\t','')
|
| 56 |
+
s=s.replace('\n','')
|
| 57 |
+
s=s.replace(',}','}')
|
| 58 |
+
s=s.replace(',]',']')
|
| 59 |
json_loader=JSONLoader(
|
| 60 |
temp_filepath=os.path.join(temp_dir.name, json_docs.name),
|
| 61 |
jq_schema='.',
|