Spaces:
Sleeping
Sleeping
Update Azure_api.py
Browse files- Azure_api.py +3 -0
Azure_api.py
CHANGED
|
@@ -39,6 +39,9 @@ def detect_tables(pdf_source):
|
|
| 39 |
tables.append(df)
|
| 40 |
|
| 41 |
# 4. Write all sheets into a BytesIO
|
|
|
|
|
|
|
|
|
|
| 42 |
excel_buffer = BytesIO()
|
| 43 |
with pd.ExcelWriter(excel_buffer, engine="openpyxl") as writer:
|
| 44 |
for idx, df in enumerate(tables, start=1):
|
|
|
|
| 39 |
tables.append(df)
|
| 40 |
|
| 41 |
# 4. Write all sheets into a BytesIO
|
| 42 |
+
if not tables:
|
| 43 |
+
return None
|
| 44 |
+
|
| 45 |
excel_buffer = BytesIO()
|
| 46 |
with pd.ExcelWriter(excel_buffer, engine="openpyxl") as writer:
|
| 47 |
for idx, df in enumerate(tables, start=1):
|