From 95a947b019a096b767e30ce08bf009122a0e146c Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 28 Feb 2024 11:01:33 -0500 Subject: [PATCH] fix(aurora): fixed a dangerous-default-value pylint warning in database.mysql_log() --- aurora/utilities/database.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/aurora/utilities/database.py b/aurora/utilities/database.py index 689f424..a2bcb92 100644 --- a/aurora/utilities/database.py +++ b/aurora/utilities/database.py @@ -8,7 +8,8 @@ from discord import Guild from redbot.core import data_manager from .logger import logger -from .utils import convert_timedelta_to_str, generate_dict, get_next_case_number +from .utils import (convert_timedelta_to_str, generate_dict, + get_next_case_number) def connect() -> sqlite3.Connection: @@ -118,9 +119,9 @@ async def mysql_log( resolved_by: str = None, resolved_reason: str = None, expired: bool = None, - changes: list = [], - metadata: dict = {}, -) -> int: # pylint: disable=dangerous-default-value + changes: list = None, + metadata: dict = None, +) -> int: if not timestamp: timestamp = int(time.time()) @@ -169,8 +170,8 @@ async def mysql_log( resolved_by, resolved_reason, expired, - json.dumps(changes), - json.dumps(metadata), + json.dumps(changes if changes else []), + json.dumps(metadata if metadata else {}), ) cursor.execute(sql, val)