Skip to content
This repository has been 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 opened this issue Nov 28, 2023 · 0 comments · Fixed by #785
Closed

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

sar009 opened this issue Nov 28, 2023 · 0 comments · Fixed by #785
Labels
bug Something isn't working stale_immune Immunity to stale bot

Comments

@sar009
Copy link
Contributor

sar009 commented Nov 28, 2023

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:[email protected]: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'
@sar009 sar009 added the bug Something isn't working label Nov 28, 2023
@dlawin dlawin added stale_immune Immunity to stale bot and removed triage labels Nov 29, 2023
@dlawin dlawin linked a pull request Nov 29, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working stale_immune Immunity to stale bot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants