Skip to content

Closing a newly-created cursor throws #428

Description

@batterseapower

Expected behavior

When you do this:

conn = trino.dbapi.connect(...)
cur = conn.cursor()
cur.close()

The close should succeed.

Actual behavior

The close actually fails:

trino.exceptions.OperationalError: Cancel query failed; no running query

Steps To Reproduce

conn = trino.dbapi.connect(...)
cur = conn.cursor()
cur.close()

Log output

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../python3.10/site-packages/trino/dbapi.py", line 709, in close
    self.cancel()
  File ".../python3.10/site-packages/trino/dbapi.py", line 703, in cancel
    raise trino.exceptions.OperationalError(
trino.exceptions.OperationalError: Cancel query failed; no running query

Operating System

CentOS 8

Trino Python client version

0.327.0

Trino Server version

406

Python version

3.10.8

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions