Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid clone of stats_handler in a place where we don't have GIL
Browse files Browse the repository at this point in the history
westonpace committed Jan 28, 2025
1 parent 0179c9c commit 5b84e93
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/src/dataset.rs
Original file line number Diff line number Diff line change
@@ -604,8 +604,7 @@ impl Dataset {
let stats_handler = stats_handler.unbind();
let stats_handler = ScanStatisticsHandler::Custom(Arc::new(move |stats| {
let wrapped_stats = LanceScanStats::new(stats);
let stats_handler = stats_handler.clone();
Python::with_gil(move |py| {
Python::with_gil(|py| {
let args = PyTuple::new_bound(py, vec![wrapped_stats.into_py(py)]);
stats_handler.call1(py, args)
})

0 comments on commit 5b84e93

Please sign in to comment.