From 12ba3f163e7df76e20a8c7a07b916db9f2032a91 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Tue, 14 Jan 2025 11:40:41 +0000 Subject: [PATCH] Clean script.py; Move more files and functions; ruff --- .../counterpartycore/lib/api/api_v1.py | 12 +++---- .../counterpartycore/lib/api/dbbuilder.py | 5 +-- .../counterpartycore/lib/api/queries.py | 3 +- .../counterpartycore/lib/api/util.py | 3 +- .../counterpartycore/lib/api/wsgi.py | 9 +++--- .../counterpartycore/lib/cli/bootstrap.py | 3 +- .../counterpartycore/lib/cli/log.py | 5 +-- .../counterpartycore/lib/cli/server.py | 2 +- .../counterpartycore/lib/cli/setup.py | 1 + .../counterpartycore/lib/messages/order.py | 2 +- .../lib/messages/utils/mpma_encoding.py | 2 +- .../counterpartycore/lib/parser/check.py | 1 + .../lib/parser/deserialize.py | 1 + .../counterpartycore/lib/parser/follow.py | 3 +- .../counterpartycore/lib/tools/sentry.py | 1 + .../test/fixtures/contract_vectors/ledger.py | 14 ++++---- .../contract_vectors/messages/issuance.py | 32 +++++++++---------- .../test/fixtures/contract_vectors/util.py | 2 +- .../counterpartycore/test/mainnet_test.py | 8 ++--- .../test/regtest/testscenarios.py | 6 ++-- .../counterpartycore/test/util_test.py | 4 +-- 21 files changed, 65 insertions(+), 54 deletions(-) diff --git a/counterparty-core/counterpartycore/lib/api/api_v1.py b/counterparty-core/counterpartycore/lib/api/api_v1.py index 082bea705c..893fd25351 100644 --- a/counterparty-core/counterpartycore/lib/api/api_v1.py +++ b/counterparty-core/counterpartycore/lib/api/api_v1.py @@ -202,7 +202,7 @@ def get_rows( def value_to_marker(value): # if value is an array place holder is (?,?,?,..) if isinstance(value, list): - return f"""({','.join(['?' for e in range(0, len(value))])})""" + return f"""({",".join(["?" for e in range(0, len(value))])})""" else: return """?""" @@ -288,10 +288,10 @@ def value_to_marker(value): for filter_ in filters: case_sensitive = False if "case_sensitive" not in filter_ else filter_["case_sensitive"] if filter_["op"] == "LIKE" and case_sensitive == False: # noqa: E712 - filter_["field"] = f"""UPPER({filter_['field']})""" + filter_["field"] = f"""UPPER({filter_["field"]})""" filter_["value"] = filter_["value"].upper() marker = value_to_marker(filter_["value"]) - conditions.append(f"""{filter_['field']} {filter_['op']} {marker}""") + conditions.append(f"""{filter_["field"]} {filter_["op"]} {marker}""") if isinstance(filter_["value"], list): bindings += filter_["value"] else: @@ -332,10 +332,10 @@ def value_to_marker(value): statement += """ WHERE""" all_conditions = [] if len(conditions) > 0: - all_conditions.append(f"""({f' {filterop.upper()} '.join(conditions)})""") + all_conditions.append(f"""({f" {filterop.upper()} ".join(conditions)})""") if len(more_conditions) > 0: - all_conditions.append(f"""({' AND '.join(more_conditions)})""") - statement += f""" {' AND '.join(all_conditions)}""" + all_conditions.append(f"""({" AND ".join(more_conditions)})""") + statement += f""" {" AND ".join(all_conditions)}""" # ORDER BY if order_by != None: # noqa: E711 diff --git a/counterparty-core/counterpartycore/lib/api/dbbuilder.py b/counterparty-core/counterpartycore/lib/api/dbbuilder.py index ac11f6c363..5b52683c1b 100644 --- a/counterparty-core/counterpartycore/lib/api/dbbuilder.py +++ b/counterparty-core/counterpartycore/lib/api/dbbuilder.py @@ -4,12 +4,13 @@ import sys import time -from counterpartycore.lib import config -from counterpartycore.lib.cli import log from yoyo import get_backend, read_migrations from yoyo.exceptions import LockTimeout from yoyo.migrations import topological_sort +from counterpartycore.lib import config +from counterpartycore.lib.cli import log + logger = logging.getLogger(config.LOGGER_NAME) CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/counterparty-core/counterpartycore/lib/api/queries.py b/counterparty-core/counterpartycore/lib/api/queries.py index 9c17bda109..021e78d03b 100644 --- a/counterparty-core/counterpartycore/lib/api/queries.py +++ b/counterparty-core/counterpartycore/lib/api/queries.py @@ -2,9 +2,10 @@ import typing from typing import Literal -from counterpartycore.lib.api.util import divide from sentry_sdk import start_span as start_sentry_span +from counterpartycore.lib.api.util import divide + OrderStatus = Literal["all", "open", "expired", "filled", "cancelled"] OrderMatchesStatus = Literal["all", "pending", "completed", "expired"] BetStatus = Literal["cancelled", "dropped", "expired", "filled", "open"] diff --git a/counterparty-core/counterpartycore/lib/api/util.py b/counterparty-core/counterpartycore/lib/api/util.py index b510fa3476..48caf50ad8 100644 --- a/counterparty-core/counterpartycore/lib/api/util.py +++ b/counterparty-core/counterpartycore/lib/api/util.py @@ -11,6 +11,8 @@ import flask import requests import werkzeug +from docstring_parser import parse as parse_docstring + from counterpartycore.lib import ( backend, composer, @@ -20,7 +22,6 @@ util, ) from counterpartycore.lib.api import compose -from docstring_parser import parse as parse_docstring D = decimal.Decimal logger = logging.getLogger(config.LOGGER_NAME) diff --git a/counterparty-core/counterpartycore/lib/api/wsgi.py b/counterparty-core/counterpartycore/lib/api/wsgi.py index 23bf8bbf2a..b8ea92b00e 100644 --- a/counterparty-core/counterpartycore/lib/api/wsgi.py +++ b/counterparty-core/counterpartycore/lib/api/wsgi.py @@ -8,15 +8,16 @@ import gunicorn.app.base import waitress import waitress.server -from counterpartycore.lib import config, database, ledger, util -from counterpartycore.lib.api import api_watcher -from counterpartycore.lib.api.util import BackendHeight -from counterpartycore.lib.cli import log from gunicorn import util as gunicorn_util from gunicorn.arbiter import Arbiter from gunicorn.errors import AppImportError from werkzeug.serving import make_server +from counterpartycore.lib import config, database, ledger, util +from counterpartycore.lib.api import api_watcher +from counterpartycore.lib.api.util import BackendHeight +from counterpartycore.lib.cli import log + multiprocessing.set_start_method("spawn", force=True) logger = logging.getLogger(config.LOGGER_NAME) diff --git a/counterparty-core/counterpartycore/lib/cli/bootstrap.py b/counterparty-core/counterpartycore/lib/cli/bootstrap.py index ab071f4ef0..a05d2e3905 100644 --- a/counterparty-core/counterpartycore/lib/cli/bootstrap.py +++ b/counterparty-core/counterpartycore/lib/cli/bootstrap.py @@ -9,9 +9,10 @@ import gnupg import pyzstd +from termcolor import colored, cprint + from counterpartycore.lib import config from counterpartycore.lib.cli.public_keys import PUBLIC_KEYS -from termcolor import colored, cprint def download_zst(data_dir, zst_url): diff --git a/counterparty-core/counterpartycore/lib/cli/log.py b/counterparty-core/counterpartycore/lib/cli/log.py index 604464e818..15f1be83c1 100644 --- a/counterparty-core/counterpartycore/lib/cli/log.py +++ b/counterparty-core/counterpartycore/lib/cli/log.py @@ -9,13 +9,14 @@ from multiprocessing import current_process import zmq -from counterpartycore.lib import config, util -from counterpartycore.lib.api.util import to_json from dateutil.tz import tzlocal from halo import Halo from json_log_formatter import JSONFormatter from termcolor import colored, cprint +from counterpartycore.lib import config, util +from counterpartycore.lib.api.util import to_json + logging.TRACE = logging.DEBUG - 5 logging.addLevelName(logging.TRACE, "TRACE") logging.EVENT = logging.DEBUG - 4 diff --git a/counterparty-core/counterpartycore/lib/cli/server.py b/counterparty-core/counterpartycore/lib/cli/server.py index 25ff7a8d93..16122561b7 100755 --- a/counterparty-core/counterpartycore/lib/cli/server.py +++ b/counterparty-core/counterpartycore/lib/cli/server.py @@ -223,7 +223,7 @@ def initialise_config( config.NETWORK_NAME = "testnet4" if config.REGTEST: config.NETWORK_NAME = "regtest" - network = f".{config.NETWORK_NAME }" if config.NETWORK_NAME != "mainnet" else "" + network = f".{config.NETWORK_NAME}" if config.NETWORK_NAME != "mainnet" else "" # Database if database_file: diff --git a/counterparty-core/counterpartycore/lib/cli/setup.py b/counterparty-core/counterpartycore/lib/cli/setup.py index af70bec897..66396ee2ca 100644 --- a/counterparty-core/counterpartycore/lib/cli/setup.py +++ b/counterparty-core/counterpartycore/lib/cli/setup.py @@ -8,6 +8,7 @@ from decimal import Decimal as D import appdirs + from counterpartycore.lib import config logger = logging.getLogger(config.LOGGER_NAME) diff --git a/counterparty-core/counterpartycore/lib/messages/order.py b/counterparty-core/counterpartycore/lib/messages/order.py index 534051988c..20e1db7a64 100644 --- a/counterparty-core/counterpartycore/lib/messages/order.py +++ b/counterparty-core/counterpartycore/lib/messages/order.py @@ -36,7 +36,7 @@ def initialise(db): "give_get_status_idx", "source_idx", "give_asset_idx", - "match_expire_idx" "forward_status_idx", + "match_expire_idxforward_status_idx", "backward_status_idx", "id_idx", "tx0_address_idx", diff --git a/counterparty-core/counterpartycore/lib/messages/utils/mpma_encoding.py b/counterparty-core/counterpartycore/lib/messages/utils/mpma_encoding.py index e803a7cfa6..f77e582815 100644 --- a/counterparty-core/counterpartycore/lib/messages/utils/mpma_encoding.py +++ b/counterparty-core/counterpartycore/lib/messages/utils/mpma_encoding.py @@ -93,7 +93,7 @@ def _solve_asset(db, asset_name, block_index): def _encode_compress_send_list(db, nbits, send, block_index): r = BitArray() r.append(f"uintbe:64={_solve_asset(db, send['assetName'], block_index)}") - r.append(f"uint:{nbits}={len(send['sendList'])-1}") + r.append(f"uint:{nbits}={len(send['sendList']) - 1}") for send_item in send["sendList"]: idx = send_item[0] diff --git a/counterparty-core/counterpartycore/lib/parser/check.py b/counterparty-core/counterpartycore/lib/parser/check.py index 2a8723a815..f475f44116 100644 --- a/counterparty-core/counterpartycore/lib/parser/check.py +++ b/counterparty-core/counterpartycore/lib/parser/check.py @@ -4,6 +4,7 @@ import warnings import requests + from counterpartycore.lib import config, database, ledger, util # noqa: F401 logger = logging.getLogger(config.LOGGER_NAME) diff --git a/counterparty-core/counterpartycore/lib/parser/deserialize.py b/counterparty-core/counterpartycore/lib/parser/deserialize.py index 78abada77c..d78e570204 100644 --- a/counterparty-core/counterpartycore/lib/parser/deserialize.py +++ b/counterparty-core/counterpartycore/lib/parser/deserialize.py @@ -1,4 +1,5 @@ from counterparty_rs import indexer + from counterpartycore.lib import config, util diff --git a/counterparty-core/counterpartycore/lib/parser/follow.py b/counterparty-core/counterpartycore/lib/parser/follow.py index e1cd648007..85a53b3fd3 100644 --- a/counterparty-core/counterpartycore/lib/parser/follow.py +++ b/counterparty-core/counterpartycore/lib/parser/follow.py @@ -7,6 +7,8 @@ import zmq import zmq.asyncio +from sentry_sdk import capture_exception + from counterpartycore.lib import ( backend, config, @@ -17,7 +19,6 @@ from counterpartycore.lib.parser import blocks, check, deserialize, mempool from counterpartycore.lib.tools import sentry from counterpartycore.lib.tools.telemetry.oneshot import TelemetryOneShot -from sentry_sdk import capture_exception logger = logging.getLogger(config.LOGGER_NAME) diff --git a/counterparty-core/counterpartycore/lib/tools/sentry.py b/counterparty-core/counterpartycore/lib/tools/sentry.py index 83c2c88365..6c62aad7e6 100644 --- a/counterparty-core/counterpartycore/lib/tools/sentry.py +++ b/counterparty-core/counterpartycore/lib/tools/sentry.py @@ -2,6 +2,7 @@ import os import sentry_sdk + from counterpartycore.lib import config, database from counterpartycore.lib.tools.telemetry.collectors.base import TelemetryCollectorBase diff --git a/counterparty-core/counterpartycore/test/fixtures/contract_vectors/ledger.py b/counterparty-core/counterpartycore/test/fixtures/contract_vectors/ledger.py index 01487f2274..a6f006fbd9 100644 --- a/counterparty-core/counterpartycore/test/fixtures/contract_vectors/ledger.py +++ b/counterparty-core/counterpartycore/test/fixtures/contract_vectors/ledger.py @@ -20,15 +20,15 @@ "error": (exceptions.AssetNameError, "non‐numeric asset name starts with ‘A’"), }, { - "in": (f"A{26 ** 12}", 308000), + "in": (f"A{26**12}", 308000), "error": (exceptions.AssetNameError, "numeric asset name not in range"), }, { - "in": (f"A{2 ** 64}", 308000), + "in": (f"A{2**64}", 308000), "error": (exceptions.AssetNameError, "numeric asset name not in range"), }, - {"in": (f"A{26 ** 12 + 1}", 308000), "out": 26**12 + 1}, - {"in": (f"A{2 ** 64 - 1}", 308000), "out": 2**64 - 1}, + {"in": (f"A{26**12 + 1}", 308000), "out": 26**12 + 1}, + {"in": (f"A{2**64 - 1}", 308000), "out": 2**64 - 1}, { "in": ("LONGASSETNAMES", 308000), "error": (exceptions.AssetNameError, "long asset names must be numeric"), @@ -45,8 +45,8 @@ {"in": (1, DP["default_block_index"]), "out": "XCP"}, {"in": (26**12 - 1, 308000), "out": "ZZZZZZZZZZZZ"}, {"in": (26**3, 308000), "out": "BAAA"}, - {"in": (2**64 - 1, 308000), "out": f"A{2 ** 64 - 1}"}, - {"in": (26**12 + 1, 308000), "out": f"A{26 ** 12 + 1}"}, + {"in": (2**64 - 1, 308000), "out": f"A{2**64 - 1}"}, + {"in": (26**12 + 1, 308000), "out": f"A{26**12 + 1}"}, {"in": (26**3 - 1, 308000), "error": (exceptions.AssetIDError, "too low")}, {"in": (2**64, 308000), "error": (exceptions.AssetIDError, "too high")}, ], @@ -80,7 +80,7 @@ {"in": ("PARENT",), "out": "PARENT"}, {"in": ("PARENT.nonexistent.subasset",), "out": "PARENT.nonexistent.subasset"}, {"in": ("PARENT.ILEGAL^^^",), "out": "PARENT.ILEGAL^^^"}, - {"in": ("PARENT.already.issued",), "out": f"A{26 ** 12 + 101}"}, + {"in": ("PARENT.already.issued",), "out": f"A{26**12 + 101}"}, ], "debit": [ {"in": (ADDR[0], "XCP", 1, 0), "out": None}, diff --git a/counterparty-core/counterpartycore/test/fixtures/contract_vectors/messages/issuance.py b/counterparty-core/counterpartycore/test/fixtures/contract_vectors/messages/issuance.py index c2e7974016..565ff1053a 100644 --- a/counterparty-core/counterpartycore/test/fixtures/contract_vectors/messages/issuance.py +++ b/counterparty-core/counterpartycore/test/fixtures/contract_vectors/messages/issuance.py @@ -579,7 +579,7 @@ "in": ( ADDR[0], None, - f"A{26 ** 12 + 1}", + f"A{26**12 + 1}", 1000, True, None, @@ -610,7 +610,7 @@ "in": ( ADDR[1], None, - f"A{26 ** 12 + 1}", + f"A{26**12 + 1}", 100000000, True, None, @@ -641,7 +641,7 @@ "in": ( ADDR[0], None, - f"A{26 ** 12 + 1}", + f"A{26**12 + 1}", 100000000, True, None, @@ -673,7 +673,7 @@ "in": ( ADDR[0], None, - f"A{26 ** 12 + 1}", + f"A{26**12 + 1}", 100000000, True, None, @@ -704,7 +704,7 @@ "in": ( ADDR[0], None, - f"A{26 ** 12 + 101}", + f"A{26**12 + 101}", 200000000, True, None, @@ -979,7 +979,7 @@ ), }, { - "in": (ADDR[0], f"A{2 ** 64 - 1}", 1000, None, None, False, None, None), + "in": (ADDR[0], f"A{2**64 - 1}", 1000, None, None, False, None, None), "out": ( "mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc", [], @@ -987,11 +987,11 @@ ), }, { - "in": (ADDR[0], f"A{2 ** 64}", 1000, None, True, False, None, ""), + "in": (ADDR[0], f"A{2**64}", 1000, None, True, False, None, ""), "error": (exceptions.AssetNameError, "numeric asset name not in range"), }, { - "in": (ADDR[0], f"A{26 ** 12}", 1000, None, True, False, None, ""), + "in": (ADDR[0], f"A{26**12}", 1000, None, True, False, None, ""), "error": (exceptions.AssetNameError, "numeric asset name not in range"), }, { @@ -1098,7 +1098,7 @@ { "in": ( ADDR[0], - f"A{26 ** 12 + 101}", + f"A{26**12 + 101}", 200000000, None, True, @@ -1592,7 +1592,7 @@ { "table": "issuances", "values": { - "asset": f"A{26 ** 12 + 1}", + "asset": f"A{26**12 + 1}", "asset_longname": "PARENT.child1", "block_index": DP["default_block_index"], "description": "", @@ -1612,7 +1612,7 @@ "table": "credits", "values": { "address": "mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc", - "asset": f"A{26 ** 12 + 1}", + "asset": f"A{26**12 + 1}", "block_index": DP["default_block_index"], "calling_function": "issuance", "event": "71da4fac29d6442ef3ff13f291860f512a888161ae9e574f313562851912aace", @@ -1634,7 +1634,7 @@ "table": "assets", "values": { "asset_id": int(26**12 + 1), - "asset_name": f"A{26 ** 12 + 1}", + "asset_name": f"A{26**12 + 1}", "block_index": DP["default_block_index"], "asset_longname": "PARENT.child1", }, @@ -1666,7 +1666,7 @@ { "table": "issuances", "values": { - "asset": f"A{26 ** 12 + 1}", + "asset": f"A{26**12 + 1}", "asset_longname": "PARENT.child1", "block_index": DP["default_block_index"], "description": "hello world", @@ -1686,7 +1686,7 @@ "table": "credits", "values": { "address": "mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc", - "asset": f"A{26 ** 12 + 1}", + "asset": f"A{26**12 + 1}", "block_index": DP["default_block_index"], "calling_function": "issuance", "event": "71da4fac29d6442ef3ff13f291860f512a888161ae9e574f313562851912aace", @@ -1708,7 +1708,7 @@ "table": "assets", "values": { "asset_id": int(26**12 + 1), - "asset_name": f"A{26 ** 12 + 1}", + "asset_name": f"A{26**12 + 1}", "block_index": DP["default_block_index"], "asset_longname": "PARENT.child1", }, @@ -1986,7 +1986,7 @@ { "table": "issuances", "values": { - "asset": f"A{26 ** 12 + 101}", + "asset": f"A{26**12 + 101}", "asset_longname": "PARENT.already.issued", "block_index": DP["default_block_index"], "description": "description", diff --git a/counterparty-core/counterpartycore/test/fixtures/contract_vectors/util.py b/counterparty-core/counterpartycore/test/fixtures/contract_vectors/util.py index 21460f7dfc..a361c73851 100644 --- a/counterparty-core/counterpartycore/test/fixtures/contract_vectors/util.py +++ b/counterparty-core/counterpartycore/test/fixtures/contract_vectors/util.py @@ -209,7 +209,7 @@ "create_issuance", { "source": ADDR[0], - "asset": f"A{2 ** 64 - 1}", + "asset": f"A{2**64 - 1}", "quantity": 1000, "encoding": "multisig", }, diff --git a/counterparty-core/counterpartycore/test/mainnet_test.py b/counterparty-core/counterpartycore/test/mainnet_test.py index 95a62b8fde..265a21e820 100644 --- a/counterparty-core/counterpartycore/test/mainnet_test.py +++ b/counterparty-core/counterpartycore/test/mainnet_test.py @@ -33,14 +33,14 @@ def get_last_block_api_v1(api_url): } response = requests.post(api_url, data=json.dumps(payload), headers=headers, timeout=10).json() last_block_index = response["result"]["last_block"]["block_index"] - version = f'v{response["result"]["version_major"]}.{response["result"]["version_minor"]}.{response["result"]["version_revision"]}' + version = f"v{response['result']['version_major']}.{response['result']['version_minor']}.{response['result']['version_revision']}" return last_block_index, version def get_last_block_api_v2(api_url): response = requests.get(f"{api_url}/v2/", timeout=10).json() last_block_index = response["result"]["counterparty_height"] - version = f'v{response["result"]["version"]}' + version = f"v{response['result']['version']}" return last_block_index, version @@ -59,14 +59,14 @@ def get_last_block_api_xcpdev(api_url): response = xcpdev_query(f"{api_url}blocks") last_block_index = response["data"]["blocks"][0]["block_index"] response = xcpdev_query(f"{api_url}") - version = f'v{response["data"]["node"]["COUNTERPARTY_VERSION"]}' + version = f"v{response['data']['node']['COUNTERPARTY_VERSION']}" return last_block_index, version def get_last_block_api_wtf(api_url): response = requests.get(f"{api_url}runningInfo", timeout=10).json() last_block_index = response["result"]["last_block"]["block_index"] - version = f'v{response["result"]["version_major"]}.{response["result"]["version_minor"]}.{response["result"]["version_revision"]}' + version = f"v{response['result']['version_major']}.{response['result']['version_minor']}.{response['result']['version_revision']}" return last_block_index, version diff --git a/counterparty-core/counterpartycore/test/regtest/testscenarios.py b/counterparty-core/counterpartycore/test/regtest/testscenarios.py index b53a19bb68..25bd790da8 100644 --- a/counterparty-core/counterpartycore/test/regtest/testscenarios.py +++ b/counterparty-core/counterpartycore/test/regtest/testscenarios.py @@ -83,10 +83,10 @@ def prepare_item(item, node, context): for i in reversed(range(11)): address = node.addresses[i] if "source" in item: - item["source"] = item["source"].replace(f"$ADDRESS_{i+1}", address) + item["source"] = item["source"].replace(f"$ADDRESS_{i + 1}", address) for key in item["params"]: if isinstance(item["params"][key], str): - item["params"][key] = item["params"][key].replace(f"$ADDRESS_{i+1}", address) + item["params"][key] = item["params"][key].replace(f"$ADDRESS_{i + 1}", address) for name, value in context.items(): if "source" in item: item["source"] = item["source"].replace(f"${name}", value) @@ -144,7 +144,7 @@ def control_result( ) for i in reversed(range(11)): address = node.addresses[i] - control_url = control_url.replace(f"$ADDRESS_{i+1}", address) + control_url = control_url.replace(f"$ADDRESS_{i + 1}", address) result = node.api_call(control_url) if ( diff --git a/counterparty-core/counterpartycore/test/util_test.py b/counterparty-core/counterpartycore/test/util_test.py index 23a6632872..28c8136797 100644 --- a/counterparty-core/counterpartycore/test/util_test.py +++ b/counterparty-core/counterpartycore/test/util_test.py @@ -726,7 +726,7 @@ def check_record(record, server_db, pytest_config): value = cursor.execute(sql).fetchall()[0][field] assert value == record["value"] else: - sql = f"""SELECT COUNT(*) AS c FROM {record['table']} """ # noqa: S608 + sql = f"""SELECT COUNT(*) AS c FROM {record["table"]} """ # noqa: S608 sql += """WHERE """ bindings = [] conditions = [] @@ -747,7 +747,7 @@ def check_record(record, server_db, pytest_config): f"SELECT * FROM {record['table']} WHERE block_index = {record['values']['block_index']}: " # noqa: S608 ) pprint.PrettyPrinter(indent=4).pprint( - list(cursor.execute(f"""SELECT * FROM {record['table']}""")) # noqa: S608 + list(cursor.execute(f"""SELECT * FROM {record["table"]}""")) # noqa: S608 ) raise AssertionError(