Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eden-D-Zhang committed Jan 22, 2025
1 parent 2b841fa commit 89299ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

# Command/Argument Constants
from clp_package_utils.scripts.native.archive_manager import (
FIND_COMMAND,
DEL_COMMAND,
BY_IDS_COMMAND,
BY_FILTER_COMMAND,
BEGIN_TS_ARG,
END_TS_ARG,
BY_FILTER_COMMAND,
BY_IDS_COMMAND,
DEL_COMMAND,
DRY_RUN_ARG,
END_TS_ARG,
FIND_COMMAND,
)

logger = logging.getLogger(__file__)
Expand Down Expand Up @@ -112,7 +112,7 @@ def main(argv):
nargs="+",
help="List of archive IDs to delete",
)

# Delete by filter subcommand
del_filter_parser = del_subparsers.add_parser(
BY_FILTER_COMMAND,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,15 @@ def _delete_archives(
if BY_FILTER_COMMAND == command:
criteria = "begin_timestamp >= %s AND end_timestamp <= %s"
elif BY_IDS_COMMAND == command:
criteria = "id in (%s)" % ','.join(['%s'] * len(params))
criteria = "id in (%s)" % ",".join(["%s"] * len(params))

db_cursor.execute(f"""
db_cursor.execute(
f"""
DELETE FROM `{table_prefix}archives`
WHERE {criteria}
RETURNING id
""",
params
params,
)
results = db_cursor.fetchall()

Expand Down

0 comments on commit 89299ca

Please sign in to comment.