Skip to content

Commit

Permalink
v0.5.2 Properly close KVFile DBs
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Mar 22, 2024
1 parent fb49f91 commit c756ef8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dataflows/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.1
0.5.2
1 change: 1 addition & 0 deletions dataflows/processors/duplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def saver(resource, db, batch_size):
def loader(db):
for _, value in db.items():
yield value
db.close()


def duplicate(
Expand Down
2 changes: 2 additions & 0 deletions dataflows/processors/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ def func(package: PackageWrapper):
process_datapackage(package.pkg.descriptor)
yield package.pkg
yield from new_resource_iterator(package)
db.close()
db_keys_usage.close()

return func

Expand Down
1 change: 1 addition & 0 deletions dataflows/processors/sort_rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def process(rows):
db.insert(process(rows), batch_size=batch_size)
for _, value in db.items(reverse=reverse):
yield value
db.close()


def sort_rows(key, resources=None, reverse=False, batch_size=1000):
Expand Down

0 comments on commit c756ef8

Please sign in to comment.