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

DeprecationWarning in _advance_tasklet #999

Open
johncarter-phntm opened this issue Aug 1, 2024 · 0 comments
Open

DeprecationWarning in _advance_tasklet #999

johncarter-phntm opened this issue Aug 1, 2024 · 0 comments
Labels
api: datastore Issues related to the googleapis/python-ndb API.

Comments

@johncarter-phntm
Copy link

Deprecation warning here in python 3.12:

yielded = self.generator.throw(type(error), error, traceback)

Environment details

  1. API: python-ndb
  2. OS type and version: Ubuntu 22.04
  3. Python version and virtual environment information: 3.12.3
  4. google-cloud- version: google-cloud-ndb==2.3.1

Steps to reproduce

  1. Call get_by_id with something that triggers an error, e.g. an out of range value

Code example

from google.cloud import ndb


class MyModel():
  foo = ndb.IntegerProperty()

def test_foo():
  # trigger an out of range error
  MyModel.get_by_id(15521907085945043008)

Stack trace

self = _TaskletFuture('get') <126572934096624>, send_value = None

    def _advance_tasklet(self, send_value=None, error=None):
        """Advance a tasklet one step by sending in a value or error."""
        # Avoid Python 2.7 import error
        from google.cloud.ndb import context as context_module
    
        try:
            with self.context.use():
                # Send the next value or exception into the generator
                if error:
                    traceback = error.__traceback__
>                   yielded = self.generator.throw(type(error), error, traceback)
E                   DeprecationWarning: the (type, exc, tb) signature of throw() is deprecated, use the single-arg signature instead.
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/python-ndb API. label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/python-ndb API.
Projects
None yet
Development

No branches or pull requests

1 participant