Skip to content

Commit

Permalink
Flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgesFTW committed Dec 15, 2023
1 parent 6769605 commit 0e64ec0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion logpyle/runalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ def make_wrapped_db(
if gather:
db = auto_gather(filenames)
else:
assert len(filenames) == 1, "Enable autogather to support multiple input files"
assert len(filenames) == 1, \
"Enable autogather to support multiple input files"
db = sqlite3.connect(filenames[0])
db.create_aggregate("stddev", 1, StdDeviation) # type: ignore[arg-type]
db.create_aggregate("var", 1, Variance)
Expand Down
7 changes: 3 additions & 4 deletions logpyle/upgrade_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import logging
import shutil
import sqlite3
from pickle import dumps

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -74,15 +75,13 @@ def upgrade_conn(conn: sqlite3.Connection) -> sqlite3.Connection:
ADD run_id integer;
""")

from pickle import dumps
schema_version = 3
value = bytes(dumps(schema_version))
if gathered:
conn.execute("UPDATE runs SET schema_version=3")
# conn.execute("UPDATE runs SET schema_version = ?", (value,))
else:
# conn.execute("UPDATE constants SET value=3 WHERE name='schema_version'")
conn.execute("UPDATE constants SET value = ? WHERE name='schema_version'", (value,))
conn.execute("UPDATE constants SET value = ? WHERE name='schema_version'",
(value,))

return conn

Expand Down

0 comments on commit 0e64ec0

Please sign in to comment.