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

Update firestore filtering #431

Closed
spbnick opened this issue May 26, 2023 · 5 comments · Fixed by #480
Closed

Update firestore filtering #431

spbnick opened this issue May 26, 2023 · 5 comments · Fixed by #480
Labels
good first issue Good for newcomers

Comments

@spbnick
Copy link
Collaborator

spbnick commented May 26, 2023

Our tests have started producing a deprecation warning from the Firestore API:

kcidb/test_monitor.py::test_email_generated[empty_deployment]
  /opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/google/cloud/firestore_v1/base_collection.py:290: UserWarning: Detected filter using positional arguments. Prefer using the 'filter' keyword argument instead.
    return query.where(field_path, op_string, value)

Update the interface we're using so the warning disappears.

@spbnick spbnick added the good first issue Good for newcomers label May 26, 2023
@mharyam
Copy link
Contributor

mharyam commented Sep 16, 2023

Hello @spbnick, can I work on this?

@spbnick
Copy link
Collaborator Author

spbnick commented Sep 18, 2023

Heeey, Maryam! Long time no see 😀 Sure, feel free to pick this up!

@mharyam
Copy link
Contributor

mharyam commented Sep 19, 2023

Heeey, Maryam! Long time no see 😀 Sure, feel free to pick this up!

It's been a while 😄, will send a PR soon

@mharyam
Copy link
Contributor

mharyam commented Oct 9, 2023

@spbnick
Sorry, I am just getting back. I have been dealing with setting up the project.

I realized I am not getting the same depreciation message as the one above. I am using Python 3.11.6. Does the Python version matter?

Or should I focus on fixing the depreciation error I am getting for mine, since I couldn't reproduce yours?

This is what mine is showing
Screenshot 2023-10-10 at 12 19 44 AM

@spbnick
Copy link
Collaborator Author

spbnick commented Nov 1, 2023

@mharyam, no, we cannot do anything regarding the deprecation warnings you see, this is for Google to fix, I think.

You need a deployment to reproduce this. You could create a Google Cloud project, do a test deployment there, and run the test to see this. I can give you the commands to do this, if you'd like to do that.

However, here's an example of this appearing in the wild: https://github.com/kernelci/kcidb/actions/runs/6695988962/job/18193278781#step:8:257

danghai added a commit that referenced this issue Dec 3, 2023
Fix: #431
UserWarning in build log: Detected filter using positional arguments.
Prefer using the 'filter' keyword argument instead
The filter argument takes BaseFilter class which is an abstract class
and it is implemented in FieldFilter. This class can be imported from
google.cloud.firestore_v1.base_query
Reference: googleapis/python-firestore#705
	   GoogleCloudPlatform/python-docs-samples#10407
spbnick pushed a commit that referenced this issue Dec 5, 2023
Fix: #431
UserWarning in build log: Detected filter using positional arguments.
Prefer using the 'filter' keyword argument instead
The filter argument takes BaseFilter class which is an abstract class
and it is implemented in FieldFilter. This class can be imported from
google.cloud.firestore_v1.base_query
Reference: googleapis/python-firestore#705
	   GoogleCloudPlatform/python-docs-samples#10407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants