Datasets:
Fix NaT issue when reading timestamp
Browse files- diffusiondb.py +6 -2
diffusiondb.py
CHANGED
|
@@ -348,7 +348,9 @@ class DiffusionDB(datasets.GeneratorBasedBuilder):
|
|
| 348 |
"width": row["width"],
|
| 349 |
"height": row["height"],
|
| 350 |
"user_name": row["user_name"],
|
| 351 |
-
"timestamp":
|
|
|
|
|
|
|
| 352 |
"image_nsfw": row["image_nsfw"],
|
| 353 |
"prompt_nsfw": row["prompt_nsfw"],
|
| 354 |
}
|
|
@@ -398,7 +400,9 @@ class DiffusionDB(datasets.GeneratorBasedBuilder):
|
|
| 398 |
"width": query_result["width"].to_list()[0],
|
| 399 |
"height": query_result["height"].to_list()[0],
|
| 400 |
"user_name": query_result["user_name"].to_list()[0],
|
| 401 |
-
"timestamp":
|
|
|
|
|
|
|
| 402 |
"image_nsfw": query_result["image_nsfw"].to_list()[0],
|
| 403 |
"prompt_nsfw": query_result["prompt_nsfw"].to_list()[0],
|
| 404 |
}
|
|
|
|
| 348 |
"width": row["width"],
|
| 349 |
"height": row["height"],
|
| 350 |
"user_name": row["user_name"],
|
| 351 |
+
"timestamp": None
|
| 352 |
+
if pd.isnull(row["timestamp"])
|
| 353 |
+
else row["timestamp"],
|
| 354 |
"image_nsfw": row["image_nsfw"],
|
| 355 |
"prompt_nsfw": row["prompt_nsfw"],
|
| 356 |
}
|
|
|
|
| 400 |
"width": query_result["width"].to_list()[0],
|
| 401 |
"height": query_result["height"].to_list()[0],
|
| 402 |
"user_name": query_result["user_name"].to_list()[0],
|
| 403 |
+
"timestamp": None
|
| 404 |
+
if pd.isnull(query_result["timestamp"].to_list()[0])
|
| 405 |
+
else query_result["timestamp"].to_list()[0],
|
| 406 |
"image_nsfw": query_result["image_nsfw"].to_list()[0],
|
| 407 |
"prompt_nsfw": query_result["prompt_nsfw"].to_list()[0],
|
| 408 |
}
|