Skip to content
Open
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
1 change: 1 addition & 0 deletions papermill/iorw.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
try:
from pyarrow.fs import FileSelector, HadoopFileSystem
except ImportError:
FileSelector = missing_dependency_generator("pyarrow", "hdfs")
Comment on lines 49 to +52
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title/description says it replaces a deprecated from pyarrow import HadoopFileSystem import, but the code already imports HadoopFileSystem from pyarrow.fs here. Please double-check whether the intended import change is already present on the target branch (and update the PR description/title), or whether this diff is missing the actual deprecated-import replacement.

Copilot uses AI. Check for mistakes.
HadoopFileSystem = missing_dependency_generator("pyarrow", "hdfs")

Comment on lines +52 to 54
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing_dependency_generator returns a zero-arg function. Assigning it to FileSelector/HadoopFileSystem means later calls like HadoopFileSystem(host="default") and FileSelector(path) will raise TypeError (unexpected args) instead of the intended PapermillOptionalDependencyException. Wrap the generator so the stub accepts *args, **kwargs (or adjust missing_dependency_generator) and raises the optional-dependency exception for both symbols; consider adding a regression test for missing-pyarrow behavior in the HDFS handler.

Suggested change
FileSelector = missing_dependency_generator("pyarrow", "hdfs")
HadoopFileSystem = missing_dependency_generator("pyarrow", "hdfs")
_missing_pyarrow_hdfs = missing_dependency_generator("pyarrow", "hdfs")
def FileSelector(*args, **kwargs):
return _missing_pyarrow_hdfs()
def HadoopFileSystem(*args, **kwargs):
return _missing_pyarrow_hdfs()

Copilot uses AI. Check for mistakes.
try:
Expand Down
Loading