Skip to content

Commit b70d181

Browse files
Michael Christensenim-michaelc
authored andcommitted
Fix pylint warnings
1 parent eeba09a commit b70d181

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/amazon-keyspaces-mcp-server/awslabs/amazon_keyspaces_mcp_server/server.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ async def list_keyspaces(
371371
description='Lists all tables in a specified keyspace - args: keyspace',
372372
)
373373
async def list_tables(
374-
input: KeyspaceInput,
374+
input: KeyspaceInput, # pylint: disable=redefined-builtin
375375
ctx: Optional[Context] = None,
376376
) -> str:
377377
"""Lists all tables in a specified keyspace."""
@@ -384,7 +384,7 @@ async def list_tables(
384384
description='Gets detailed information about a keyspace - args: keyspace',
385385
)
386386
async def describe_keyspace(
387-
input: KeyspaceInput,
387+
input: KeyspaceInput, # pylint: disable=redefined-builtin
388388
ctx: Optional[Context] = None,
389389
) -> str:
390390
"""Gets detailed information about a keyspace."""
@@ -397,7 +397,7 @@ async def describe_keyspace(
397397
description='Gets detailed information about a table - args: keyspace, table',
398398
)
399399
async def describe_table(
400-
input: TableInput,
400+
input: TableInput, # pylint: disable=redefined-builtin
401401
ctx: Optional[Context] = None,
402402
) -> str:
403403
"""Gets detailed information about a table."""
@@ -410,7 +410,7 @@ async def describe_table(
410410
description='Executes a read-only SELECT query against the database - args: keyspace, query',
411411
)
412412
async def execute_query(
413-
input: QueryInput,
413+
input: QueryInput, # pylint: disable=redefined-builtin
414414
ctx: Optional[Context] = None,
415415
) -> str:
416416
"""Executes a read-only (SELECT) query against the database."""
@@ -423,7 +423,7 @@ async def execute_query(
423423
description='Analyzes the performance characteristics of a CQL query - args: keyspace, query',
424424
)
425425
async def analyze_query_performance(
426-
input: QueryInput,
426+
input: QueryInput, # pylint: disable=redefined-builtin
427427
ctx: Optional[Context] = None,
428428
) -> str:
429429
"""Analyzes the performance characteristics of a CQL query."""
@@ -732,17 +732,17 @@ async def _handle_analyze_query_performance(
732732

733733
def main():
734734
"""Run the MCP server."""
735-
import asyncio
736-
735+
import asyncio # pylint: disable=import-outside-toplevel
736+
737737
# Validate connection before starting server
738738
try:
739739
proxy = asyncio.run(get_proxy())
740740
asyncio.run(proxy.schema_service.cassandra_client.get_session())
741741
logger.success('Successfully validated database connection')
742-
except Exception as e:
742+
except Exception as e: # pylint: disable=broad-exception-caught
743743
logger.error(f'Failed to connect to database: {e}')
744744
sys.exit(1)
745-
745+
746746
mcp.run()
747747

748748

src/amazon-keyspaces-mcp-server/tests/test_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ async def test_ssl_context_load_error(self, mock_ssl, mock_cluster_class):
222222
mock_ssl.SSLError = ssl.SSLError
223223

224224
# Make load_verify_locations raise an exception
225-
mock_ssl_context.load_verify_locations.side_effect = FileNotFoundError('Certificate not found')
225+
mock_ssl_context.load_verify_locations.side_effect = FileNotFoundError(
226+
'Certificate not found'
227+
)
226228

227229
# Create the client and get session
228230
client = UnifiedCassandraClient(self.keyspaces_config)
@@ -728,7 +730,9 @@ async def test_execute_read_only_query_with_column_error(self):
728730
mock_column_names = ['id', 'bad_column']
729731
mock_row = Mock()
730732
mock_row.id = 1
731-
type(mock_row).bad_column = property(lambda self: (_ for _ in ()).throw(ValueError('Bad column')))
733+
type(mock_row).bad_column = property(
734+
lambda self: (_ for _ in ()).throw(ValueError('Bad column'))
735+
)
732736

733737
mock_result_set = Mock()
734738
mock_result_set.column_names = mock_column_names

0 commit comments

Comments
 (0)