fix: inconsistent ids

This commit is contained in:
2026-07-26 17:51:46 +02:00
parent 11b805b627
commit 29acd9594d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ def generateBernAsianHornetFeed(ASSETS, CACHE):
for start, end in weeklyRangesFrom(arbitraryStartDate): # arbitrary start date
weeklyEntry = {}
weeklyEntry["id"] = datetime.combine(start, time(12, 0)).timestamp() # we use epoch time as the id
weeklyEntry["id"] = f"asian-hornets-bern-{start.isoformat()}-{end.isoformat()}" # we use epoch time as the id EDIT: NO THIS BROKE MULTIPLE TIMES MAKING SOME ID CHANGES. WE CHANGE THAT
weeklyEntry["creationDate"] = end.isoformat()
weeklyEntry["date"] = end.isoformat() # there is no point of updating it later, as (I think) data isn't retroactively put
weeklyEntry["source"] = "opendata.swiss"
+1 -1
View File
@@ -271,7 +271,7 @@ def generateBernReligionMap(ASSETS, CACHE):
}
for start, end in trimesterRangesFrom(arbitraryStartDate):
trimestrialEntry = {}
trimestrialEntry["id"] = datetime.combine(start, time(12, 0)).timestamp() # we use timestamp as ids
trimestrialEntry["id"] = f"religion-map-bern-{start.isoformat()}-{end.isoformat()}" # timestamps from epoch are unreliable
trimestrialEntry["creationDate"] = start.isoformat()
trimestrialEntry["date"] = start.isoformat() # there is no point have them different. On other feeds it's used for update date
trimestrialEntry["source"] = "opendata.swiss"