tests/find #32
1 changed files with 2 additions and 2 deletions
proper row interation
Some checks failed
Mypy / mypy (push) Successful in 1m14s
Pytest / pytest (3.12) (push) Successful in 1m20s
Pytest / pytest (3.13) (push) Successful in 1m11s
Pytest / pytest (3.14) (push) Successful in 1m16s
Ruff / ruff (push) Successful in 1m2s
Ruff / ruff (pull_request) Waiting to run
Mypy / mypy (pull_request) Successful in 1m13s
Pytest / pytest (3.12) (pull_request) Has been cancelled
Pytest / pytest (3.13) (pull_request) Has been cancelled
Pytest / pytest (3.14) (pull_request) Has been cancelled
Some checks failed
Mypy / mypy (push) Successful in 1m14s
Pytest / pytest (3.12) (push) Successful in 1m20s
Pytest / pytest (3.13) (push) Successful in 1m11s
Pytest / pytest (3.14) (push) Successful in 1m16s
Ruff / ruff (push) Successful in 1m2s
Ruff / ruff (pull_request) Waiting to run
Mypy / mypy (pull_request) Successful in 1m13s
Pytest / pytest (3.12) (pull_request) Has been cancelled
Pytest / pytest (3.13) (pull_request) Has been cancelled
Pytest / pytest (3.14) (pull_request) Has been cancelled
commit
b625bf9243
|
|
@ -5,7 +5,7 @@ import pandas as pd
|
|||
import sqlite3
|
||||
|
||||
|
||||
def has_valid_times(result: pd.DataFrame) -> bool:
|
||||
def has_valid_times(result: pd.Series) -> bool:
|
||||
# we expect created_at <= updated_at <= now
|
||||
created_at = dt.datetime.fromisoformat(result['created_at'])
|
||||
updated_at = dt.datetime.fromisoformat(result['updated_at'])
|
||||
|
|
@ -34,7 +34,7 @@ def check_db_integrity(path: Path) -> None:
|
|||
conn = sqlite3.connect(db)
|
||||
results = pd.read_sql(search_expr, conn)
|
||||
|
||||
for result in results:
|
||||
for _, result in results.iterrows():
|
||||
if not has_valid_times(result):
|
||||
raise ValueError(f"Result with id {result[id]} has wrong time signatures.")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue