diff --git a/postgrest/base_request_builder.py b/postgrest/base_request_builder.py index 62cd57c9..08679449 100644 --- a/postgrest/base_request_builder.py +++ b/postgrest/base_request_builder.py @@ -35,13 +35,7 @@ from pydantic import validator as field_validator from .types import CountMethod, Filters, RequestMethod, ReturnMethod -from .utils import ( - AsyncClient, - SyncClient, - get_origin_and_cast, - sanitize_param, - sanitize_pattern_param, -) +from .utils import AsyncClient, SyncClient, get_origin_and_cast, sanitize_param class QueryArgs(NamedTuple): @@ -347,7 +341,6 @@ def like(self: Self, column: str, pattern: str) -> Self: column: The name of the column to apply a filter on pattern: The pattern to filter by """ - pattern = sanitize_pattern_param(pattern) return self.filter(column, Filters.LIKE, pattern) def like_all_of(self: Self, column: str, pattern: str) -> Self: @@ -397,7 +390,6 @@ def ilike(self: Self, column: str, pattern: str) -> Self: column: The name of the column to apply a filter on pattern: The pattern to filter by """ - pattern = sanitize_pattern_param(pattern) return self.filter(column, Filters.ILIKE, pattern) def or_(self: Self, filters: str, reference_table: Union[str, None] = None) -> Self: diff --git a/tests/_async/test_filter_request_builder.py b/tests/_async/test_filter_request_builder.py index 1be041cf..1deeeba2 100644 --- a/tests/_async/test_filter_request_builder.py +++ b/tests/_async/test_filter_request_builder.py @@ -190,25 +190,13 @@ def test_overlaps_with_timestamp_range(filter_request_builder): def test_like(filter_request_builder): builder = filter_request_builder.like("x", "%a%") - assert str(builder.params) == "x=like.%2Aa%2A" - - -def test_like2(filter_request_builder): - builder = filter_request_builder.like("x", f"%{85770204020}%") # See bug #830. - - assert str(builder.params) == "x=like.%2A85770204020%2A" + assert str(builder.params) == "x=like.%a%" def test_ilike(filter_request_builder): builder = filter_request_builder.ilike("x", "%a%") - assert str(builder.params) == "x=ilike.%2Aa%2A" - - -def test_ilike2(filter_request_builder): - builder = filter_request_builder.ilike("x", f"%{85770204020}%") # See bug #830. - - assert str(builder.params) == "x=ilike.%2A85770204020%2A" + assert str(builder.params) == "x=ilike.%a%" def test_like_all_of(filter_request_builder): diff --git a/tests/_sync/test_filter_request_builder.py b/tests/_sync/test_filter_request_builder.py index cc50d66c..37434cf8 100644 --- a/tests/_sync/test_filter_request_builder.py +++ b/tests/_sync/test_filter_request_builder.py @@ -190,25 +190,13 @@ def test_overlaps_with_timestamp_range(filter_request_builder): def test_like(filter_request_builder): builder = filter_request_builder.like("x", "%a%") - assert str(builder.params) == "x=like.%2Aa%2A" - - -def test_like2(filter_request_builder): - builder = filter_request_builder.like("x", f"%{85770204020}%") # See bug #830. - - assert str(builder.params) == "x=like.%2A85770204020%2A" + assert str(builder.params) == "x=like.%a%" def test_ilike(filter_request_builder): builder = filter_request_builder.ilike("x", "%a%") - assert str(builder.params) == "x=ilike.%2Aa%2A" - - -def test_ilike2(filter_request_builder): - builder = filter_request_builder.ilike("x", f"%{85770204020}%") # See bug #830. - - assert str(builder.params) == "x=ilike.%2A85770204020%2A" + assert str(builder.params) == "x=ilike.%a%" def test_like_all_of(filter_request_builder):