Spaces:
Running
Running
Commit
·
3e3178a
1
Parent(s):
e93499e
fix description being optional in hf_api
Browse files
src/hf_eda_mcp/integrations/hf_client.py
CHANGED
|
@@ -120,7 +120,6 @@ class HfClient:
|
|
| 120 |
metadata = {
|
| 121 |
"id": dataset_info.id,
|
| 122 |
"author": dataset_info.author or "unknown",
|
| 123 |
-
"description": dataset_info.description or "",
|
| 124 |
"tags": dataset_info.tags or [],
|
| 125 |
"downloads": getattr(dataset_info, "downloads", 0),
|
| 126 |
"likes": getattr(dataset_info, "likes", 0),
|
|
@@ -135,6 +134,11 @@ class HfClient:
|
|
| 135 |
"features": {},
|
| 136 |
}
|
| 137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
# Extract configuration information
|
| 139 |
if hasattr(dataset_info, "card_data") and dataset_info.card_data:
|
| 140 |
configs = getattr(dataset_info.card_data, "configs", [])
|
|
|
|
| 120 |
metadata = {
|
| 121 |
"id": dataset_info.id,
|
| 122 |
"author": dataset_info.author or "unknown",
|
|
|
|
| 123 |
"tags": dataset_info.tags or [],
|
| 124 |
"downloads": getattr(dataset_info, "downloads", 0),
|
| 125 |
"likes": getattr(dataset_info, "likes", 0),
|
|
|
|
| 134 |
"features": {},
|
| 135 |
}
|
| 136 |
|
| 137 |
+
if hasattr(dataset_info, "description"):
|
| 138 |
+
metadata["description"] = dataset_info.description
|
| 139 |
+
else:
|
| 140 |
+
metadata["description"] = ""
|
| 141 |
+
|
| 142 |
# Extract configuration information
|
| 143 |
if hasattr(dataset_info, "card_data") and dataset_info.card_data:
|
| 144 |
configs = getattr(dataset_info.card_data, "configs", [])
|
src/hf_eda_mcp/tools/metadata.py
CHANGED
|
@@ -39,7 +39,7 @@ def get_dataset_metadata(dataset_id: str, config_name: Optional[str] = None, hf_
|
|
| 39 |
Dictionary containing comprehensive dataset metadata:
|
| 40 |
- id: Dataset identifier
|
| 41 |
- author: Dataset author/organization
|
| 42 |
-
- description: Dataset description
|
| 43 |
- features: Dictionary of feature names and types
|
| 44 |
- splits: Dictionary of split names and their sizes
|
| 45 |
- configs: List of available configurations
|
|
|
|
| 39 |
Dictionary containing comprehensive dataset metadata:
|
| 40 |
- id: Dataset identifier
|
| 41 |
- author: Dataset author/organization
|
| 42 |
+
- description: Dataset description if available
|
| 43 |
- features: Dictionary of feature names and types
|
| 44 |
- splits: Dictionary of split names and their sizes
|
| 45 |
- configs: List of available configurations
|