ozgur/python-firebase

Order by (orderBy) filter requires quoted param in get request

Opened this issue · 1 comments

Using:
result = firebase_app.get("/", "article", params={"startAt": "100", "orderBy": "msrp"})
Return the error
Bad Request for url: https://pennywise.firebaseio.com/article.json?orderBy=msrp&startAt=10

To get it working, a manual insertion of quotes is required.
result = firebase_app.get("/", "article", params={"startAt": "100", "orderBy": "\"msrp\""})
Returns successfully

My issue, if the orderBy params requires quotes it should be handled in the backend call.

I got the same issue, but doing the manual insertion of quotes did not work for me. Can @sshadmand , or someone please help?

response = firebase.get('/', "orders", params={"orderBy": ""CreatedTime""})

Traceback (most recent call last):
File "test_get_orders.py", line 11, in
response = firebase.get('/', "orders", params={"orderBy": ""CreatedTime""})
File "/Library/Python/2.7/site-packages/python_firebase-1.2-py2.7.egg/firebase/decorators.py", line 19, in wrapped
return f(_args, *_kwargs)
File "/Library/Python/2.7/site-packages/python_firebase-1.2-py2.7.egg/firebase/firebase.py", line 274, in get
return make_get_request(endpoint, params, headers, connection=connection)
File "/Library/Python/2.7/site-packages/python_firebase-1.2-py2.7.egg/firebase/decorators.py", line 19, in wrapped
return f(_args, *_kwargs)
File "/Library/Python/2.7/site-packages/python_firebase-1.2-py2.7.egg/firebase/firebase.py", line 42, in make_get_request
response.raise_for_status()
File "/Library/Python/2.7/site-packages/requests-2.9.1-py2.7.egg/requests/models.py", line 840, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://log.firebaseio.com/orders.json?orderBy=%22CreatedTime%22