test the pr: claude/fix-sql-injection-table-names-zw7os
- User
test the pr: claude/fix-sql-injection-table-names-zw7os
Assistant
Let me explore the project structure and existing tests, then write and run tests for this PR.
Assistant
Now let me write tests. I'll create a test file covering both the helper functions and the database integration.
Assistant
One test failed — my expectation was wrong.
os.path.splitext(".csv")returns('.csv', '')(Python treats it as a hidden file with no extension), so the stem is.csv→ sanitized tocsv. Let me fix the test.Assistant
All 37 tests pass. Let me also run the full test suite to make sure the PR doesn't break existing tests.
Assistant
All 53 tests pass (16 existing + 37 new). Here's the test results summary:
PR Test Results:
claude/fix-sql-injection-table-names-zw7os37 new tests written, covering all three layers of the fix:
_escape_identifier(8 tests)- Simple names, spaces, SQL keywords, single quotes
- Embedded double quotes are correctly doubled (
"→"") - Semicolons and injection payloads are safely wrapped in quotes
sanitize_table_name(14 tests)- Strips file extensions (
.csv,.json,.parquet,.xlsx) - Replaces spaces, hyphens, dots, unicode → underscores
- Collapses consecutive underscores, strips leading/trailing
- User
Please commit all of my changes so we can make a PR.
Assistant
Let me check the current state of things.
Assistant
Committed as
fd5fa9a. The new test file is now on theclaude/fix-sql-injection-table-names-zw7osbranch, ready for the PR. Want me to push it?