Skip to content

Using context manager for automatic connection cleanup throws AttributeError #393

@DimensionWieldr

Description

@DimensionWieldr

Description

When running the following code from the chdb doc page:

>>> # Using context manager for automatic cleanup
>>> with connect("data.db") as conn:
...     result = conn.query("SELECT 1")
...     print(result)

an attribute error is thrown.

How to reproduce

  • chDB version: 3.6.0
  • Python version: 3.8.10
  • Start the Python interactive interpreter
  • Enter the code from the description above

Expected behavior

Output:

1

Connection is automatically closed.

Actual behaviour

Error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: __enter__

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