related ignores or nosec annotations

This commit is contained in:
Taddes 2026-03-30 14:51:49 -04:00
parent 46638d7c24
commit fcf34c509e
No known key found for this signature in database
GPG Key ID: BBAB431AFDB9B793
5 changed files with 10 additions and 11 deletions

View File

@ -94,7 +94,7 @@ def purge_records(args: argparse.Namespace) -> None:
if args.mode in ["batches", "both"]:
(batch_query, params) = add_conditions(
args,
f"DELETE FROM batches WHERE {expiry_condition}",
f"DELETE FROM batches WHERE {expiry_condition}", # nosec B608
)
exec_delete(
engine,
@ -107,7 +107,7 @@ def purge_records(args: argparse.Namespace) -> None:
if args.mode in ["bsos", "both"]:
(bso_query, params) = add_conditions(
args,
f"DELETE FROM bsos WHERE {expiry_condition}",
f"DELETE FROM bsos WHERE {expiry_condition}", # nosec B608
)
exec_delete(
engine,

View File

@ -55,7 +55,7 @@ if __name__ == "__main__":
logging.info("Starting count_expired_rows.py")
for table in ["batches", "bsos"]:
query = f"SELECT COUNT(*) FROM {table} WHERE expiry < CURRENT_TIMESTAMP()"
query = f"SELECT COUNT(*) FROM {table} WHERE expiry < CURRENT_TIMESTAMP()" # nosec B608
spanner_read_data(query, table)
logging.info("Completed count_expired_rows.py")

View File

@ -135,7 +135,7 @@ def spanner_purge(args: argparse.Namespace) -> None:
# IN PARENT batches ON DELETE CASCADE)
(batch_query, params, types) = add_conditions(
args,
f"DELETE FROM batches WHERE {expiry_condition}",
f"DELETE FROM batches WHERE {expiry_condition}", # nosec B608
prefix,
)
deleter(
@ -151,7 +151,7 @@ def spanner_purge(args: argparse.Namespace) -> None:
if args.mode in ["bsos", "both"]:
# Delete BSOs
(bso_query, params, types) = add_conditions(
args, f"DELETE FROM bsos WHERE {expiry_condition}", prefix
args, f"DELETE FROM bsos WHERE {expiry_condition}", prefix # nosec B608
)
deleter(
database,

View File

@ -78,7 +78,7 @@ def _track_account_creation(email: str, password: str, fxa_uid: str) -> None:
with open(_ACCT_TRACKING_FILE, "w") as f:
json.dump(accounts, f, indent=2)
except Exception:
except Exception: # nosec B110
# continue with tests
pass
@ -105,7 +105,7 @@ def _remove_account_from_tracking(email: str) -> None:
with open(_ACCT_TRACKING_FILE, "w") as f:
json.dump(accounts, f, indent=2)
except Exception:
except Exception: # nosec B110
pass

View File

@ -642,10 +642,9 @@ class Database:
if "nodeid" in kwds:
cols.append("id")
args.append(":nodeid")
query = """
insert into nodes ({cols})
values ({args})
""".format(cols=", ".join(cols), args=", ".join(args))
query = "insert into nodes ({cols}) values ({args})".format( # nosec B608
cols=", ".join(cols), args=", ".join(args)
)
res = self._execute_sql(
sqltext(query),
nodeid=kwds.get("nodeid"),