fix(right-wing): match store_scores column names and value order to DB schema
This commit is contained in:
@@ -228,10 +228,10 @@ def store_scores(db_path: str, results: list[dict[str, Any]]) -> int:
|
|||||||
"""
|
"""
|
||||||
CREATE TABLE IF NOT EXISTS extremity_scores_2d (
|
CREATE TABLE IF NOT EXISTS extremity_scores_2d (
|
||||||
motion_id INTEGER PRIMARY KEY,
|
motion_id INTEGER PRIMARY KEY,
|
||||||
stylistic_score INTEGER NOT NULL,
|
stijl_extremiteit INTEGER NOT NULL,
|
||||||
material_score INTEGER NOT NULL,
|
stijl_toelichting TEXT,
|
||||||
stylistic_rationale TEXT,
|
materiele_impact INTEGER NOT NULL,
|
||||||
material_rationale TEXT
|
materiele_toelichting TEXT
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
@@ -241,14 +241,14 @@ def store_scores(db_path: str, results: list[dict[str, Any]]) -> int:
|
|||||||
con.execute(
|
con.execute(
|
||||||
"""
|
"""
|
||||||
INSERT OR REPLACE INTO extremity_scores_2d
|
INSERT OR REPLACE INTO extremity_scores_2d
|
||||||
(motion_id, stylistic_score, material_score, stylistic_rationale, material_rationale)
|
(motion_id, stijl_extremiteit, stijl_toelichting, materiele_impact, materiele_toelichting)
|
||||||
VALUES (?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?)
|
||||||
""",
|
""",
|
||||||
(
|
(
|
||||||
r["motion_id"],
|
r["motion_id"],
|
||||||
r["stijl_extremiteit"],
|
r["stijl_extremiteit"],
|
||||||
r["materiele_impact"],
|
|
||||||
r.get("stijl_toelichting"),
|
r.get("stijl_toelichting"),
|
||||||
|
r["materiele_impact"],
|
||||||
r.get("materiele_toelichting"),
|
r.get("materiele_toelichting"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ class TestStoreScores:
|
|||||||
con = duckdb.connect(tmp_duckdb_path)
|
con = duckdb.connect(tmp_duckdb_path)
|
||||||
try:
|
try:
|
||||||
rows = con.execute(
|
rows = con.execute(
|
||||||
"SELECT motion_id, stylistic_score, material_score "
|
"SELECT motion_id, stijl_extremiteit, materiele_impact "
|
||||||
"FROM extremity_scores_2d ORDER BY motion_id"
|
"FROM extremity_scores_2d ORDER BY motion_id"
|
||||||
).fetchall()
|
).fetchall()
|
||||||
assert len(rows) == 2
|
assert len(rows) == 2
|
||||||
@@ -206,7 +206,7 @@ class TestStoreScores:
|
|||||||
con = duckdb.connect(tmp_duckdb_path)
|
con = duckdb.connect(tmp_duckdb_path)
|
||||||
try:
|
try:
|
||||||
rows = con.execute(
|
rows = con.execute(
|
||||||
"SELECT stylistic_score, material_score FROM extremity_scores_2d WHERE motion_id = 1"
|
"SELECT stijl_extremiteit, materiele_impact FROM extremity_scores_2d WHERE motion_id = 1"
|
||||||
).fetchall()
|
).fetchall()
|
||||||
assert rows[0] == (5, 5)
|
assert rows[0] == (5, 5)
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in New Issue
Block a user