Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: used json.dumps instead of str in sanitize_params #161

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion postgrest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
from httpx import AsyncClient # noqa: F401
from httpx import Client as BaseClient # noqa: F401

import json



class SyncClient(BaseClient):
def aclose(self) -> None:
self.close()


def sanitize_param(param: Any) -> str:
param_str = str(param)
param_str = json.dumps(param)
reserved_chars = ",:()"
if any(char in param_str for char in reserved_chars):
return f'"{param_str}"'
Expand Down
Loading