postgrest-py icon indicating copy to clipboard operation
postgrest-py copied to clipboard

Use json.dumps instead of str in sanitize_params

Open dreinon opened this issue 2 years ago • 4 comments

Hi! It turns out that since we use the str callable to convert a value to string, the output of str([True, 1, 'hi']) would be "[True, 1, 'hi']" instead of the json values '[true, 1, "hi"]'. This forces the user to convert data to string before sending it to our client instead of sending it as regular python types, which could be solved using json.dumps instead of str for this purpose.

dreinon avatar Jun 18 '22 18:06 dreinon

Can you add a link to the code where this is being done as well? Would make it easy for anyone to make a fix PR 😄 (unless you were planning on making one yourself)

anand2312 avatar Jun 19 '22 01:06 anand2312

I'm unfortunately not using my laptop rn, can you add it for me @anand2312? It is the first line of sanitize_params function, which can be found by searching the function name.

dreinon avatar Jun 19 '22 01:06 dreinon

Link to the code where this fix should go.

nitd24 avatar Aug 03 '22 06:08 nitd24

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar May 01 '24 01:05 github-actions[bot]