Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.
This repository was archived by the owner on May 17, 2024. It is now read-only.

DB Connection is not closed automatically and close function fails #784

Closed
@sar009

Description

@sar009

Describe the bug
The established db connections are not closed automatically when the data diff is completed more over when calling for close() it throws an attribute error since super has no close function.

from data_diff import connect

uri = "redshift://user:password@host.region.redshift.amazonaws.com:5439/dev"
database = connect(url, 1)
database.close()

the code above throws the following error

AttributeError                            Traceback (most recent call last)
Cell In[8], line 1
----> 1 x.close()

File /opt/homebrew/lib/python3.11/site-packages/data_diff/databases/base.py:1214, in ThreadedDatabase.close(self)
   1213 def close(self):
-> 1214     super().close()
   1215     self._queue.shutdown()

File /opt/homebrew/lib/python3.11/site-packages/data_diff/databases/base.py:1145, in Database.close(self)
   1143 "Close connection(s) to the database instance. Querying will stop functioning."
   1144 self.is_closed = True
-> 1145 return super().close()

AttributeError: 'super' object has no attribute 'close'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale_immuneImmunity to stale bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions