Skip to content

UserWarning: Detected filter using positional arguments. #705

@XGeffrier

Description

@XGeffrier

Hello python-firestore team!
Thanks for this very useful lib and product.

A lot of my queries have recently triggered a UserWarning.

Minimal reproducible example:

import firebase_admin
from firebase_admin import credentials, firestore

# auth and instanciate client
cred = credentials.Certificate({...})
firebase_admin.initialize_app(cred)
db = firestore.client()

# perform simple "where" query
collection = db.collection("myCollection")
out = collection.where("field", "==", "value").get()

The final line triggers: UserWarning: Detected filter using positional arguments. Prefer using the 'filter' keyword argument instead.

It looks like it comes from this snippet, but I'm not skilled enough to investigate further.

I may use the filter keyword but I can't find any explanation in the doc on how to use it, and feel like I'm using the where method the way it was intended. Could you please either document the usage of filter keyword (and tell me what I'm doing wrong) or remove the warning if it should not be triggered?

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: firestoreIssues related to the googleapis/python-firestore API.type: docsImprovement to the documentation for an API.type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions