Skip to content

Commit

Permalink
fix dask imports, try skipping r-sanitizers jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Mar 17, 2024
1 parent f1aa403 commit e789b15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ jobs:
all-r-package-jobs-successful:
if: always()
runs-on: ubuntu-latest
needs: [test, test-r-sanitizers, test-r-debian-clang]
needs: [test, test-r-debian-clang]
steps:
- name: Note that all tests succeeded
uses: re-actors/alls-green@v1.2.2
Expand Down
12 changes: 11 additions & 1 deletion python-package/lightgbm/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,17 @@ class _LGBMRegressorBase: # type: ignore
from dask.distributed import Client, Future, default_client, wait

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

dask_array_from_delayed = None # type: ignore[assignment]
Expand Down

0 comments on commit e789b15

Please sign in to comment.