fix: tests and linters (ruff format)
This commit is contained in:
3 files changed
+3
-9
No files matched your search
@@ -124,9 +124,7 @@ def _upsert_guild(
|
|||||||
connection.execute(f"UPDATE guilds SET {field}=%s WHERE id=%s", (value, guild_id))
|
connection.execute(f"UPDATE guilds SET {field}=%s WHERE id=%s", (value, guild_id))
|
||||||
|
|
||||||
|
|
||||||
def _import_history(
|
def _import_history(connection: psycopg.Connection[Any], guild_id: int, entries: list[Any]) -> None:
|
||||||
connection: psycopg.Connection[Any], guild_id: int, entries: list[Any]
|
|
||||||
) -> None:
|
|
||||||
_ensure_guild(connection, guild_id)
|
_ensure_guild(connection, guild_id)
|
||||||
if connection.execute(
|
if connection.execute(
|
||||||
"SELECT 1 FROM history_entries WHERE guild_id=%s LIMIT 1", (guild_id,)
|
"SELECT 1 FROM history_entries WHERE guild_id=%s LIMIT 1", (guild_id,)
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
|
|
||||||
InitialSchemaMigration = import_module(
|
InitialSchemaMigration = import_module(".0001_initial_schema", __name__).InitialSchemaMigration
|
||||||
".0001_initial_schema", __name__
|
|
||||||
).InitialSchemaMigration
|
|
||||||
|
|
||||||
MIGRATIONS = (InitialSchemaMigration(),)
|
MIGRATIONS = (InitialSchemaMigration(),)
|
||||||
@@ -25,9 +25,7 @@ class PostgresPersistence:
|
|||||||
self.config: GuildConfigRepository = PostgresGuildConfig(
|
self.config: GuildConfigRepository = PostgresGuildConfig(
|
||||||
self.database, fallback_plays=default_plays
|
self.database, fallback_plays=default_plays
|
||||||
)
|
)
|
||||||
self.history: HistoryRepository = PostgresHistory(
|
self.history: HistoryRepository = PostgresHistory(self.database, limit=history_limit)
|
||||||
self.database, limit=history_limit
|
|
||||||
)
|
|
||||||
self.queues: QueueRepository = PostgresQueue(self.database)
|
self.queues: QueueRepository = PostgresQueue(self.database)
|
||||||
self._config_dir = config_dir
|
self._config_dir = config_dir
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user