Update app.py
Browse files
app.py
CHANGED
@@ -601,18 +601,19 @@ def create_ui() -> gr.Blocks:
|
|
601 |
col_idx = evt.index[1]
|
602 |
print(f"DEBUG: Selected row {row_idx}, column {col_idx}")
|
603 |
|
604 |
-
#
|
605 |
-
|
606 |
-
|
607 |
-
repo_id = df_data[row_idx
|
608 |
print(f"DEBUG: Extracted repo_id = '{repo_id}'")
|
609 |
|
610 |
# Only proceed if we actually have a repository ID
|
611 |
-
if repo_id and repo_id.strip():
|
612 |
-
|
613 |
-
|
|
|
614 |
else:
|
615 |
-
print(f"DEBUG: df_data is not a
|
616 |
|
617 |
except Exception as e:
|
618 |
print(f"DEBUG: Exception occurred: {e}")
|
|
|
601 |
col_idx = evt.index[1]
|
602 |
print(f"DEBUG: Selected row {row_idx}, column {col_idx}")
|
603 |
|
604 |
+
# Handle pandas DataFrame
|
605 |
+
if isinstance(df_data, pd.DataFrame) and not df_data.empty and row_idx < len(df_data):
|
606 |
+
# Get the repository ID from the first column (repo id)
|
607 |
+
repo_id = df_data.iloc[row_idx, 0] # First column contains repo id
|
608 |
print(f"DEBUG: Extracted repo_id = '{repo_id}'")
|
609 |
|
610 |
# Only proceed if we actually have a repository ID
|
611 |
+
if repo_id and str(repo_id).strip() and str(repo_id).strip() != 'nan':
|
612 |
+
clean_repo_id = str(repo_id).strip()
|
613 |
+
logger.info(f"Navigating to repo explorer for repository: {clean_repo_id}")
|
614 |
+
return clean_repo_id, gr.update(selected="repo_explorer_tab")
|
615 |
else:
|
616 |
+
print(f"DEBUG: df_data is not a DataFrame or row_idx {row_idx} out of range")
|
617 |
|
618 |
except Exception as e:
|
619 |
print(f"DEBUG: Exception occurred: {e}")
|