-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from rapidsai/branch-24.06
Forward-merge branch-24.06 into branch-24.08
- Loading branch information
Showing
9 changed files
with
138 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
|
||
from .dask_loader import DaskLoader | ||
from .dask_loader import DaskFinder | ||
|
||
DaskLoader.install() | ||
DaskFinder.install() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
|
||
import importlib | ||
import importlib.util | ||
|
||
from rapids_dask_dependency.utils import patch_warning_stacklevel | ||
|
||
# Vendored files use a standard prefix to avoid name collisions. | ||
DEFAULT_VENDORED_PREFIX = "__rdd_patch_" | ||
|
||
|
||
def make_monkey_patch_loader(name, patch_func): | ||
"""Create a loader for monkey-patched modules.""" | ||
|
||
def load_module(): | ||
# Four extra stack frames: 1) DaskLoader.create_module, 2) | ||
# load_module, 3) importlib.import_module, and 4) the patched warnings function. | ||
with patch_warning_stacklevel(4): | ||
mod = importlib.import_module( | ||
name.replace("rapids_dask_dependency.patches.", "") | ||
) | ||
patch_func(mod) | ||
mod._rapids_patched = True | ||
return mod | ||
|
||
return load_module | ||
|
||
|
||
def make_vendored_loader(name): | ||
"""Create a loader for vendored modules.""" | ||
|
||
def load_module(): | ||
parts = name.split(".") | ||
parts[-1] = DEFAULT_VENDORED_PREFIX + parts[-1] | ||
mod = importlib.import_module(".".join(parts)) | ||
mod._rapids_vendored = True | ||
return mod | ||
|
||
return load_module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
|
||
from rapids_dask_dependency.importer import MonkeyPatchImporter | ||
from rapids_dask_dependency.loaders import make_monkey_patch_loader | ||
|
||
_importer = MonkeyPatchImporter(__name__, lambda _: None) | ||
load_module = _importer.load_module | ||
load_module = make_monkey_patch_loader(__name__, lambda _: None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
import sys | ||
|
||
# Currently vendoring this module due to https://github.com/dask/dask/pull/11035 | ||
if sys.version_info >= (3, 11, 9): | ||
from dask import __version__ | ||
from packaging.version import Version | ||
|
||
if Version(__version__) < Version("2024.4.1"): | ||
from rapids_dask_dependency.importer import VendoredImporter | ||
from rapids_dask_dependency.loaders import make_vendored_loader | ||
|
||
# Currently vendoring this module due to https://github.com/dask/dask/pull/11035 | ||
_importer = VendoredImporter(__name__) | ||
load_module = _importer.load_module | ||
load_module = make_vendored_loader(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
|
||
from rapids_dask_dependency.importer import MonkeyPatchImporter | ||
from rapids_dask_dependency.loaders import make_monkey_patch_loader | ||
|
||
_importer = MonkeyPatchImporter(__name__, lambda _: None) | ||
load_module = _importer.load_module | ||
load_module = make_monkey_patch_loader(__name__, lambda _: None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters