Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

update TRIM to LTRIM(RTRIM(...)) for more universal query syntax #886

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data_diff/databases/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ def normalize_boolean(self, value: str, _coltype: Boolean) -> str:
def normalize_uuid(self, value: str, coltype: ColType_UUID) -> str:
"""Creates an SQL expression, that strips uuids of artifacts like whitespace."""
if isinstance(coltype, String_UUID):
return f"TRIM({value})"
return f"LTRIM(RTRIM({value}))"
return self.to_string(value)

def normalize_json(self, value: str, _coltype: JSON) -> str:
Expand Down