Skip to content

On python 3.8 the query for 'between' in a table CANCEL TASK.... #222

@dpineiden

Description

@dpineiden

Describe the bug

In a table with extra INDEXES, I have a DT_GEN and COUNT (date and int), tested.

The between query as shows on documentation:

On (https://gitlab.com/pineiden/datadbs-rethinkdb/-/blob/master/data_rdb/rdb.py) line 316 and so on

                    table_manager = self.r.db(dbname).table(table_name)
                    task_coro = await table_manager.between(
                        lower, upper, **filter_opt).order_by(order_by).run(
                            self.session, **options)
                    result = await task_coro
Task was destroyed but it is pending!
task: <Task pending name='Task-4' coro=<ConnectionInstance._reader() running at /home/david/.virtualenvs/datawork/lib/python3.8/site-packages/rethinkdb-2.4.7-py3.8.egg/rethinkdb/asyncio_net/net_asyncio.py:313> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f7d5a713df0>()]>>

To Reproduce

Mount Rethinkdb 2.4.1
Install Python 3.8
Create a virtualenv

To install dependences and then install from repo:

pip install data-rdb
pip uninstall data-rdb

Now clone from:
https://gitlab.com/pineiden/datadbs-rethinkdb

and

python setup.py develop

On folder tests
run

python load_data.py

And

python read_data.py

Those scripts load with dummy data on a table and read that on real time.

Expected behavior

Get the data from the table

Screenshots
https://gitlab.com/-/snippets/2005380

Additional context
Add any other context about the problem here.

Well, the core of the query (only with the Rethinkdb module) and Python 3.6.9:

from pytz import timezone
from datetime import datetime, timedelta
import asyncio
from rethinkdb import r as rdb

host = 'localhost'
port = 28015
loop = asyncio.get_event_loop()
rdb.set_loop_type('asyncio')
conn = loop.run_until_complete(rdb.connect(db='test', host=host, port=port))
first = datetime.now() - timedelta(seconds=200)
tz = timezone("America/Santiago")
firsttz = tz.localize(first)
firstrdb = rdb.iso8601(firsttz.isoformat())
post = datetime.now()
posttz = tz.localize(post)
postrdb = rdb.iso8601(posttz.isoformat())
table = "STATION"
filter_opt = {'left_bound': 'open', 'index': "DT_GEN"}
print(f"Desde {firstrdb}, hasta {postrdb}")
query = rdb.db("test").table(table).between(firstrdb, postrdb,
                                            **filter_opt).run(conn)
result = loop.run_until_complete(query)
print(result)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnot qualifiedThe issue is not checked yet by the owners

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions