Skip to content

Commit

Permalink
Merge pull request #7 from bmsuisse/cffi
Browse files Browse the repository at this point in the history
use block in place to block less
  • Loading branch information
aersam authored Nov 10, 2023
2 parents 8c480b9 + 54cdbc5 commit 55b01c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "maturin"
[project]
name = "lakeapi2sql"
requires-python = ">=3.10"
version = "0.7.3"
version = "0.7.4"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
Expand Down
3 changes: 2 additions & 1 deletion src/bulk_insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use tokio_util::compat::FuturesAsyncReadCompatExt;
use tokio_util::io::SyncIoBridge;

use tokio::sync::mpsc;
use tokio::task;

use crate::arrow_convert::get_token_rows;

Expand Down Expand Up @@ -97,7 +98,7 @@ pub async fn bulk_insert_batch<'a>(
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let nrows = batch.num_rows();
info!("{table_name}: received {nrows}");
let rows = get_token_rows(batch, &collist)?;
let rows = task::block_in_place(|| get_token_rows(batch, &collist))?;
info!("{table_name}: converted {nrows}");
for rowdt in rows {
blk.send(rowdt).await?;
Expand Down

0 comments on commit 55b01c9

Please sign in to comment.