Skip to content

Commit e789b15

Browse files
committed
fix dask imports, try skipping r-sanitizers jobs
1 parent f1aa403 commit e789b15

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/r_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ jobs:
315315
all-r-package-jobs-successful:
316316
if: always()
317317
runs-on: ubuntu-latest
318-
needs: [test, test-r-sanitizers, test-r-debian-clang]
318+
needs: [test, test-r-debian-clang]
319319
steps:
320320
- name: Note that all tests succeeded
321321
uses: re-actors/alls-green@v1.2.2

python-package/lightgbm/compat.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,17 @@ class _LGBMRegressorBase: # type: ignore
164164
from dask.distributed import Client, Future, default_client, wait
165165

166166
DASK_INSTALLED = True
167-
except ImportError:
167+
# catching 'ValueError' here because of this:
168+
# https://github.com/microsoft/LightGBM/issues/6365#issuecomment-2002330003
169+
#
170+
# That's potentially risky as dask does some significant import-time processing,
171+
# like loading configuration from environment variables and files, and catching
172+
# ValueError here might hide issues with that config-loading.
173+
#
174+
# But in exchange, it's less likely that 'import lightgbm' will fail for
175+
# dask-related reasons, which is beneficial for any workloads that are using
176+
# lightgbm but not its Dask functionality.
177+
except (ImportError, ValueError):
168178
DASK_INSTALLED = False
169179

170180
dask_array_from_delayed = None # type: ignore[assignment]

0 commit comments

Comments
 (0)