Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cudf.pandas: cuDF subpath checking in module __getattr__ #14388

Merged
merged 4 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/cudf/cudf/pandas/module_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import importlib.abc
import importlib.machinery
import os
import pathlib
import sys
import threading
import warnings
Expand Down Expand Up @@ -554,9 +555,10 @@ def getattr_real_or_wrapped(
frame = sys._getframe()
# We cannot possibly be at the top level.
assert frame.f_back
calling_module = frame.f_back.f_code.co_filename
calling_module = pathlib.PurePath(frame.f_back.f_code.co_filename)
use_real = any(
calling_module.startswith(path) for path in loader._denylist
calling_module.is_relative_to(path)
for path in loader._denylist
)
try:
if use_real:
Expand Down