appwrite / sdk-for-python

[READ-ONLY] Official Appwrite Python SDK 🐍
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
230 stars 59 forks source link

πŸ› Bug Report: AttributeError: type object 'Query' has no attribute 'orderDesc' #72

Closed genki-iosdev closed 7 months ago

genki-iosdev commented 1 year ago

πŸ‘Ÿ Reproduction steps

Traceback (most recent call last): File "/usr/local/server/src/server.py", line 165, in handler output = await asyncio.wait_for(execute(context), timeout=safeTimeout) File "/usr/local/lib/python3.9/asyncio/tasks.py", line 479, in wait_for return fut.result() File "/usr/local/server/src/server.py", line 158, in execute output = userModule.main(context) File "/usr/local/server/src/function/src/main.py", line 24, in main dataOperation.spotInfoHandle() File "/usr/local/server/src/function/src/data_operation.py", line 24, in spotInfoHandle Query.orderDesc("rank"), AttributeError: type object 'Query' has no attribute 'orderDesc'

When I use the list_documents function and pass in Query.orderDesc("index_rank") as the query condition, the error occurs. I checked the implementation source code of Query and found that there was no problem, but in fact, an error was reported.

Preparing for build ... Building ... Collecting appwrite Downloading appwrite-4.0.0.tar.gz (16 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done'

I am using appwrite-4.0.0 version on the current cloud platform

πŸ‘ Expected behavior

Sorting queries can be used normally

πŸ‘Ž Actual Behavior

Traceback (most recent call last): File "/usr/local/server/src/server.py", line 165, in handler output = await asyncio.wait_for(execute(context), timeout=safeTimeout) File "/usr/local/lib/python3.9/asyncio/tasks.py", line 479, in wait_for return fut.result() File "/usr/local/server/src/server.py", line 158, in execute output = userModule.main(context) File "/usr/local/server/src/function/src/main.py", line 24, in main dataOperation.spotInfoHandle() File "/usr/local/server/src/function/src/data_operation.py", line 24, in spotInfoHandle Query.orderDesc("rank"), AttributeError: type object 'Query' has no attribute 'orderDesc'

🎲 Appwrite version

Version 0.10.x

πŸ’» Operating system

MacOS

🧱 Your Environment

No response

πŸ‘€ Have you spent some time to check if this issue has been raised before?

🏒 Have you read the Code of Conduct?

35C4n0r commented 1 year ago

@genki-iosdev I think you should try using Query.order_desc instead of Query.orderDesc

abnegate commented 7 months ago

@genki-iosdev, the comment above is the correct fix