Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 540aa2b

Browse files
authored
Merge pull request #57 from nihar1024/main
fix: clean imported layer attribute mapping, update pt analysis reference dates
2 parents 6ea2eab + 8f15da1 commit 540aa2b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/crud/crud_layer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,11 @@ async def import_file(
829829
for field_name in field_names:
830830
if field_name == "id":
831831
continue
832-
attribute_mapping[field_type + "_attr" + str(cnt)] = field_name
832+
# Replace hyphens with an underscore as ogr2ogr also does this while importing the layer
833+
# TODO: Find a more robust way to sync changes made by ogr2ogr to field names and this attribute mapping
834+
attribute_mapping[field_type + "_attr" + str(cnt)] = field_name.replace(
835+
"-", "_"
836+
)
833837
cnt += 1
834838

835839
# Upload file to temporary table using ogr2ogr

src/schemas/toolbox_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ def weekday_integer(self):
236236
@property
237237
def weekday_date(self):
238238
mapping = {
239-
"weekday": "2024-04-08",
240-
"saturday": "2024-04-13",
241-
"sunday": "2024-04-14",
239+
"weekday": "2025-02-18",
240+
"saturday": "2025-02-22",
241+
"sunday": "2025-02-23",
242242
}
243243
return mapping[PTSupportedDay(self.weekday).value]
244244

0 commit comments

Comments
 (0)