Skip to content

Commit c95e8b1

Browse files
committed
Refactor caching logic to use a local variable for IPython environment check
1 parent 509850e commit c95e8b1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/dataframe.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,11 @@ impl PyDataFrame {
313313
// Get the Python formatter and config
314314
let PythonFormatter { formatter, config } = get_python_formatter_with_config(py)?;
315315

316+
let is_ipython = *is_ipython_env(py);
317+
316318
let (cached_batches, should_cache) = {
317319
let mut cache = self.batches.lock();
318-
let should_cache = *is_ipython_env(py) && cache.is_none();
320+
let should_cache = is_ipython && cache.is_none();
319321
let batches = cache.take();
320322
(batches, should_cache)
321323
};

0 commit comments

Comments
 (0)