Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -184,7 +184,10 @@ async def lifespan(app: FastAPI):
|
|
| 184 |
hostel_df = masters.get("Hostels", pd.DataFrame())
|
| 185 |
if not hostel_df.empty:
|
| 186 |
for _, row in hostel_df.iterrows():
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
| 188 |
hostel_map[hid] = {
|
| 189 |
"hostel_id": hid,
|
| 190 |
"name": str(row.get("HostelName", row.get("HostelName_Old", ""))).strip(),
|
|
|
|
| 184 |
hostel_df = masters.get("Hostels", pd.DataFrame())
|
| 185 |
if not hostel_df.empty:
|
| 186 |
for _, row in hostel_df.iterrows():
|
| 187 |
+
raw_id = str(row["HostelID"]).strip()
|
| 188 |
+
if not raw_id.isdigit():
|
| 189 |
+
continue # skip bad rows (address in ID column etc.)
|
| 190 |
+
hid = int(raw_id)
|
| 191 |
hostel_map[hid] = {
|
| 192 |
"hostel_id": hid,
|
| 193 |
"name": str(row.get("HostelName", row.get("HostelName_Old", ""))).strip(),
|