Update google_sheets.py
Browse files- google_sheets.py +4 -0
google_sheets.py
CHANGED
@@ -68,6 +68,9 @@ def fetch_call_data(sheet_id, sheet_range="Sheet1!A1:E"):
|
|
68 |
# Get the rows
|
69 |
rows = result.get("values", [])
|
70 |
|
|
|
|
|
|
|
71 |
# If rows exist, convert to DataFrame
|
72 |
if rows:
|
73 |
# Use the first row as column headers
|
@@ -80,6 +83,7 @@ def fetch_call_data(sheet_id, sheet_range="Sheet1!A1:E"):
|
|
80 |
return df
|
81 |
else:
|
82 |
# Return an empty DataFrame if no data
|
|
|
83 |
return pd.DataFrame()
|
84 |
|
85 |
except Exception as e:
|
|
|
68 |
# Get the rows
|
69 |
rows = result.get("values", [])
|
70 |
|
71 |
+
# Log the fetched rows for debugging
|
72 |
+
print(f"Fetched rows: {rows}")
|
73 |
+
|
74 |
# If rows exist, convert to DataFrame
|
75 |
if rows:
|
76 |
# Use the first row as column headers
|
|
|
83 |
return df
|
84 |
else:
|
85 |
# Return an empty DataFrame if no data
|
86 |
+
print("No data found in the specified range.")
|
87 |
return pd.DataFrame()
|
88 |
|
89 |
except Exception as e:
|