Spaces:
Runtime error
Runtime error
twdruhot commited on
Commit ·
e66f9e1
1
Parent(s): c29bb77
Update Home.py
Browse files
Home.py
CHANGED
|
@@ -142,17 +142,15 @@ def application():
|
|
| 142 |
def report():
|
| 143 |
inputs = '|'.join(str(x) for x in st.session_state.inputs)
|
| 144 |
data = {'rprtd': date.today(),'inpts': inputs, 'title': st.session_state.output_dict[st.session_state.desc_iter]['titles'][st.session_state.title_iter][0], 'desc':st.session_state.output_dict[st.session_state.desc_iter]['text']}
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
s3.put_object(Body=r_df.to_json() ,Bucket='auto-bg', Key='reported.json')
|
| 155 |
-
|
| 156 |
###Variables
|
| 157 |
|
| 158 |
###Data
|
|
|
|
| 142 |
def report():
|
| 143 |
inputs = '|'.join(str(x) for x in st.session_state.inputs)
|
| 144 |
data = {'rprtd': date.today(),'inpts': inputs, 'title': st.session_state.output_dict[st.session_state.desc_iter]['titles'][st.session_state.title_iter][0], 'desc':st.session_state.output_dict[st.session_state.desc_iter]['text']}
|
| 145 |
+
|
| 146 |
+
s3=session.client('s3')
|
| 147 |
+
reportedjson = s3.get_object(Bucket='auto-bg', Key='reported.json')
|
| 148 |
+
r_d = pd.read_json(reportedjson.get("Body"))
|
| 149 |
+
r_df = pd.DataFrame(data, index=[len(r_d)+1])
|
| 150 |
+
w_p = pd.concat([r_df, r_d])
|
| 151 |
+
w_p = w_p.drop_duplicates().reset_index(drop=True)
|
| 152 |
+
s3.put_object(Body=w_p.to_json() ,Bucket='auto-bg', Key='reported.json')
|
| 153 |
+
|
|
|
|
|
|
|
| 154 |
###Variables
|
| 155 |
|
| 156 |
###Data
|