Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions sdk/python/feast/infra/online_stores/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ def online_write_batch(
write_batch_size = online_config.write_batch_size
feast_project = config.project

pool = ThreadPool(processes=write_concurrency)
pool.map(
lambda b: self._write_minibatch(client, feast_project, table, b, progress),
self._to_minibatches(data, batch_size=write_batch_size),
)
with ThreadPool(processes=write_concurrency) as pool:
pool.map(
lambda b: self._write_minibatch(
client, feast_project, table, b, progress
),
self._to_minibatches(data, batch_size=write_batch_size),
)

@staticmethod
def _to_minibatches(data: ProtoBatch, batch_size) -> Iterator[ProtoBatch]:
Expand Down