From f4dbd66bcaaeac134a5baca19fe461b90c151213 Mon Sep 17 00:00:00 2001 From: khushthecoder Date: Fri, 24 Apr 2026 21:47:41 +0530 Subject: [PATCH] Fix #1308: Remove dead dask.config.set() at module import time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module-level call in ag3.py: dask.config.set(**{"array.slicing.split_native_chunks": False}) was historically present to silence a dask `PerformanceWarning` emitted on certain slicing operations. On current dask (>=2025), the `array.slicing.split_native_chunks` config key is unrecognised (returns no default) and the associated `PerformanceWarning` has been removed from `dask.array.slicing`. The setting therefore has no observable effect in any currently-supported dask version. Removing the line directly addresses the filed bug — `import malariagen_data` no longer modifies global dask configuration — without introducing scoped context managers or any other new machinery. Verified: - `import malariagen_data` leaves `dask.config.get('array.slicing. split_native_chunks', 'DEFAULT') == 'DEFAULT'`. - `tests/anoph/test_snp_data.py` (193 tests), `test_frq.py`, `test_cnv_data.py`, `test_hapclust.py`, `test_dipclust.py`, `test_hap_data.py`, `test_aim_data.py` all pass with no new warnings; in particular no `PerformanceWarning` is emitted from any of the `da.take` / `da.compress` call sites in `util.py` or `snp_data.py`. - pre-commit, ruff, ruff-format, mypy all clean. --- malariagen_data/ag3.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/malariagen_data/ag3.py b/malariagen_data/ag3.py index ae425a79f..5a22e045e 100644 --- a/malariagen_data/ag3.py +++ b/malariagen_data/ag3.py @@ -1,14 +1,10 @@ import sys -import dask import pandas as pd # type: ignore import plotly.express as px # type: ignore import malariagen_data from .anopheles import AnophelesDataResource -# silence dask performance warnings -dask.config.set(**{"array.slicing.split_native_chunks": False}) # type: ignore - MAJOR_VERSION_NUMBER = 3 MAJOR_VERSION_PATH = "v3" CONFIG_PATH = "v3-config.json"