Skip to content

Commit 52b26a0

Browse files
committed
update process_ej_dump to use new model choice values
1 parent 334f138 commit 52b26a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/ej/cmr_to_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
def process_ej_dump(file_path: str) -> None:
1313
"""Process EJ dump file and create database entries."""
1414

15-
destination_server = EnvironmentalJusticeRow.DestinationServerChoices.DEV
15+
data_source = EnvironmentalJusticeRow.DataSourceChoices.ML_PRODUCTION
1616

1717
# Clear existing data
18-
EnvironmentalJusticeRow.objects.filter(destination_server=destination_server).delete()
18+
EnvironmentalJusticeRow.objects.filter(data_source=data_source).delete()
1919

2020
# Load the preprocessed data
2121
with open(file_path) as f:
@@ -24,7 +24,7 @@ def process_ej_dump(file_path: str) -> None:
2424
# Create database entries
2525
for entry in clean_data:
2626
ej_row = EnvironmentalJusticeRow(
27-
destination_server=destination_server,
27+
data_source=data_source,
2828
sde_link=entry["sde_link"],
2929
dataset=entry["dataset"],
3030
description=entry["description"],
@@ -47,4 +47,4 @@ def process_ej_dump(file_path: str) -> None:
4747
ej_row.save()
4848

4949

50-
process_ej_dump("backups/ej_dump_20241120_211754.json")
50+
process_ej_dump("backups/ej_dump_20241203_170124.json")

0 commit comments

Comments
 (0)