fix: replace commas with dots in depth values

v0.4
rrr-marble 3 years ago
parent 14616e8eb9
commit 1adddacf70

@ -24,7 +24,7 @@ def upgrade() -> None:
"depth_min",
sa.Float(),
sa.Computed(
"CAST(SPLIT_PART(depth,'-',1) AS DOUBLE PRECISION)",
"CAST(REGEXP_REPLACE(SPLIT_PART(depth,'-',1),',','.') AS DOUBLE PRECISION)",
),
nullable=True,
),
@ -35,7 +35,7 @@ def upgrade() -> None:
"depth_max",
sa.Float(),
sa.Computed(
"CAST(SPLIT_PART(depth,'-',1) AS DOUBLE PRECISION)",
"CAST(REGEXP_REPLACE(SPLIT_PART(depth,'-',2),',','.') AS DOUBLE PRECISION)",
),
nullable=True,
),

@ -48,11 +48,18 @@ class ItemCreate(ItemBase):
class Item(ItemBase):
# split on '-' replace ',' with '.' and cast as numeric
depth_min = Column(
Float, Computed("CAST(SPLIT_PART(depth,'-',1) AS DOUBLE PRECISION)")
Float,
Computed(
"CAST(REGEXP_REPLACE(SPLIT_PART(depth,'-',1), ',', '.') AS DOUBLE PRECISION)"
),
)
depth_max = Column(
Float, Computed("CAST(SPLIT_PART(depth,'-',2)) AS DOUBLE PRECISION")
Float,
Computed(
"CAST(REGEXP_REPLACE(SPLIT_PART(depth,'-',2), ',', '.') AS DOUBLE PRECISION)"
),
)
geodata_search_ts = Column(

Loading…
Cancel
Save