fix: sql syntax for ml tables

This commit is contained in:
Stijnvandenbroek
2026-03-11 12:34:38 +00:00
parent 1f4b7326f7
commit 8f22d8f96d
5 changed files with 8 additions and 4 deletions

View File

@@ -0,0 +1,4 @@
[sqlfluff]
# SQLAlchemy :named_param bind parameters are misinterpreted by sqlfluff
# as cast operators, causing false LT01 spacing violations. Disable here.
exclude_rules = LT01

View File

@@ -1,3 +1,3 @@
insert into elo.notified (global_id) insert into elo.notified (global_id)
values (: global_id) values (:global_id)
on conflict (global_id) do nothing on conflict (global_id) do nothing

View File

@@ -15,6 +15,6 @@ from elo.predictions as ep
inner join marts.funda_listings as fl on ep.global_id = fl.global_id inner join marts.funda_listings as fl on ep.global_id = fl.global_id
left join elo.notified as en on ep.global_id = en.global_id left join elo.notified as en on ep.global_id = en.global_id
where where
ep.predicted_elo >=: min_elo ep.predicted_elo >= :min_elo
and en.global_id is null and en.global_id is null
order by ep.predicted_elo desc order by ep.predicted_elo desc

View File

@@ -23,4 +23,4 @@ select
er.elo_rating er.elo_rating
from marts.funda_listings as fl from marts.funda_listings as fl
inner join elo.ratings as er on fl.global_id = er.global_id inner join elo.ratings as er on fl.global_id = er.global_id
where er.comparison_count >=: min_comparisons where er.comparison_count >= :min_comparisons

View File

@@ -1,5 +1,5 @@
insert into elo.predictions (global_id, predicted_elo, mlflow_run_id) insert into elo.predictions (global_id, predicted_elo, mlflow_run_id)
values (: global_id,: predicted_elo,: mlflow_run_id) values (:global_id, :predicted_elo, :mlflow_run_id)
on conflict (global_id) do update on conflict (global_id) do update
set set
predicted_elo = excluded.predicted_elo, predicted_elo = excluded.predicted_elo,