Skip to content

Commit 2aa4d45

Browse files
committed
fix: resolve black formatting and CI issues
- Make SQL f-strings multiline to prevent black reformatting - Add nosec comments to each f-string line for bandit compatibility - Add logger import to ami_cache.py to fix undefined name error - Add PyYAML installation to validate-workflows CI job - Clean up duplicate nosec comments All quality checks now pass: - Bandit: 0 issues, 16 properly suppressed - Flake8: passes - Black: formatting stable
1 parent caf33b2 commit 2aa4d45

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ jobs:
9898
enable-cache: true
9999
cache-dependency-glob: "pyproject.toml.template"
100100

101+
- name: Install PyYAML
102+
run: uv pip install PyYAML
103+
101104
- name: Validate workflows
102105
run: make validate-all
103106

src/infrastructure/persistence/components/sql_query_builder.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ def build_insert(self, data: Dict[str, Any]) -> Tuple[str, Dict[str, Any]]:
131131
# 1. Validating table_name and column names against a whitelist pattern
132132
# 2. Using parameterized queries for all values with :param syntax
133133
# nosec B608
134-
query = f"INSERT INTO {self.table_name} ({', '.join(columns)}) VALUES ({', '.join(placeholders)})" # nosec B608" # nosec B608
134+
query = (
135+
f"INSERT INTO {self.table_name} " # nosec B608
136+
f"({', '.join(columns)}) VALUES ({', '.join(placeholders)})" # nosec B608
137+
)
135138

136139
self.logger.debug(f"Built INSERT query for {self.table_name}")
137140
return query, filtered_data
@@ -150,7 +153,10 @@ def build_select_by_id(self, id_column: str) -> Tuple[str, str]:
150153
self._validate_identifier(id_column)
151154

152155
# nosec B608
153-
query = f"SELECT * FROM {self.table_name} WHERE {id_column} = :{id_column}" # nosec B608
156+
query = (
157+
f"SELECT * FROM {self.table_name} " # nosec B608
158+
f"WHERE {id_column} = :{id_column}" # nosec B608
159+
)
154160

155161
self.logger.debug(f"Built SELECT by ID query for {self.table_name}")
156162
return query, id_column

src/providers/aws/infrastructure/template/ami_cache.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
"""Runtime AMI cache for script execution with optional persistence."""
22

33
import json
4+
import logging
45
import os
56
import time
67
from contextlib import suppress
78
from typing import Dict, Optional, Set
89

10+
logger = logging.getLogger(__name__)
11+
912

1013
class RuntimeAMICache:
1114
"""

0 commit comments

Comments
 (0)