Skip to content
Back

Bug: Query params are ignored - pythonsdk

  • 0
  • Self Hosted
  • Databases
tscheeeek
7 Feb, 2025, 15:13

Trying to get a list of documents, but try different queries. It looks like the queries are ignored:

TypeScript
def get_not_processed_images_from_appwrite(databases: Databases) -> list:
    """Get all images that have not been processed."""
    unprocessed_entries = databases.list_documents(
        APPWRITE_DATABASE_ID,
        APPWRITE_COLLECTIONS_ID_CCTV_IMAGES,
        queries=[
            Query.limit(100)
        ],
    )
    return unprocessed_entries

Result is:

TypeScript
{"total": 5000, "documents":[...]}
TL;DR
Bug with pythonsdk where query params are ignored, specifically in listing documents. The developer is trying to get a list of unprocessed images with a query limit of 100 but is getting all 5000 documents instead. It seems like the queries are being ignored. The hard limit is 5000.
Kenny
7 Feb, 2025, 15:29

What are you expecting?

tscheeeek
7 Feb, 2025, 15:30

only 100 documents

Kenny
7 Feb, 2025, 15:31

And you're getting every document?

tscheeeek
7 Feb, 2025, 15:32

I get 5000, looks like it is a hard limit with 5000

Kenny
7 Feb, 2025, 15:32

Yea 5000 is the max return

Kenny
7 Feb, 2025, 15:33

The default limit is 25, so it's kind weird it's ignoring that too :P

Kenny
7 Feb, 2025, 15:33

What version of the sdk are you on and what version of appwrite are you on?

tscheeeek
7 Feb, 2025, 15:36

pythonsdk is 7.1.0 and appwrite is 1.6.0

tscheeeek
7 Feb, 2025, 15:36

it is weird because it worked some hours ago...

tscheeeek
7 Feb, 2025, 15:43

Already removed pythonsdk and added it again, restarted appwrite containers ...

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more