Repository navigation
Fix xPath init on Python < 3.12 and remote glob - #9119
Open
hamza-paracha wants to merge 1 commit into
Open
hamza-paracha wants to merge 1 commit into
hamza-paracha wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#9073 added
xPath.__init__, which broke two things on currentmain(thedeps-minimumunit and integration jobs have been failing since it merged):Python 3.10 / 3.11:
xPath.__init__passes the path arguments tosuper().__init__(). Before Python 3.12,pathlibsets up paths in__new__and does not define__init__, so the call reachesobject.__init__and raises. Anything that builds anxPathfails, including a plain localload_dataset("text", data_files=...):The fix calls the parent
__init__only on Python 3.12+.Remote
xPath.glob/rglob:download_config=was passed tostr.joininstead of thexPathconstructor, so it raisedTypeError: str.join() takes no keyword arguments.Tests: added constructor cases (no args, one and several segments, a
Pathargument, with and withoutDownloadConfig) and glob/rglob checks that the result is anxPaththat keeps itsdownload_config.pytest tests/test_file_utils.pygives 155 passed, 3 skipped (the slow Google Drive tests) on both Python 3.10.12 and 3.12.16. Before the fix, the new cases fail with the errors above.I used an AI coding assistant (Devin) for this change. I reproduced both failures and reviewed the diff and tests myself.