progressbar for inserts/upserts of other file formats

* progressbar for inserts/upserts of other file formats, closes #485
* Pin to Python 3.10.6 for the moment as workaround for mypy error

Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
Mischa Untaga 2022-09-15 22:37:51 +02:00 committed by GitHub
commit 0b315d3fa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 30 deletions

View file

@ -155,6 +155,11 @@ class UpdateWrapper:
self._update(len(line))
yield line
def read(self, size=-1):
data = self._wrapped.read(size)
self._update(len(data))
return data
@contextlib.contextmanager
def file_progress(file, silent=False, **kwargs):