Skip to content

Commit e683931

Browse files
committed
handle uuids of dataset
1 parent 8a2967e commit e683931

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

migrate_geography_metadata.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def find_geography_by_name(name: str) -> Geography | None:
6464

6565

6666
def migrate_dataset_geographies(
67-
dry_run: bool = False, remove_metadata: bool = False, dataset_id: int | None = None
67+
dry_run: bool = False, remove_metadata: bool = False, dataset_id: str | None = None
6868
) -> None:
6969
"""Migrate geography metadata to geographies field for datasets."""
7070
print("\n" + "=" * 80)
@@ -84,7 +84,7 @@ def migrate_dataset_geographies(
8484
# Find all datasets with geography metadata
8585
if dataset_id:
8686
dataset_metadata = DatasetMetadata.objects.filter(
87-
metadata_item=geo_metadata_item, dataset_id=str(dataset_id)
87+
metadata_item=geo_metadata_item, dataset_id=dataset_id
8888
).select_related("dataset", "metadata_item")
8989
else:
9090
dataset_metadata = DatasetMetadata.objects.filter(
@@ -341,8 +341,8 @@ def main() -> None:
341341
)
342342
parser.add_argument(
343343
"--dataset-id",
344-
type=int,
345-
help="Migrate only the dataset with the specified ID",
344+
type=str,
345+
help="Migrate only the dataset with the specified ID (UUID)",
346346
)
347347
parser.add_argument(
348348
"--usecase-id",

0 commit comments

Comments
 (0)