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

🐛 Bug Report: AttributeError: type object 'Query' has no attribute 'orderDesc' #72

Closed
2 tasks done
genki-iosdev opened this issue Sep 28, 2023 · 2 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@genki-iosdev
Copy link

👟 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?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@genki-iosdev genki-iosdev added the bug Something isn't working label Sep 28, 2023
@genki-iosdev genki-iosdev changed the title 🐛 Bug Report: 🐛 Bug Report: AttributeError: type object 'Query' has no attribute 'orderDesc' Sep 30, 2023
@35C4n0r
Copy link

35C4n0r commented Oct 21, 2023

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

@abnegate
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants