Skip to content

Commit

Permalink
[Issue #3050] Make sure we escape single quotes (#3051)
Browse files Browse the repository at this point in the history
## Summary
Fixes #3050 

### Time to review: __2 mins__

## Changes proposed
Make sure we're escaping single quotes in our DB strings

## Context for reviewers
Tests started failing due to a string with "children's" in it
All tests are now passing locally
  • Loading branch information
mdragon authored Nov 26, 2024
1 parent 2bd43c0 commit 0df81b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/tests/src/data_migration/test_copy_oracle_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def convert_value_for_insert(value) -> str:
if isinstance(value, int):
return str(value)
if isinstance(value, str):
return f"'{value}'" # noqa: B907
return f"'{value.replace("'", "''")}'" # noqa: B907
if isinstance(value, date):
return f"'{value.isoformat()}'" # noqa: B907

Expand Down

0 comments on commit 0df81b5

Please sign in to comment.