fix(datasets): Explicitly convert paths to str in ibis.FileDataset#1380
Open
fix(datasets): Explicitly convert paths to str in ibis.FileDataset#1380
Conversation
Signed-off-by: Laura Couto <laurarccouto@gmail.com>
deepyaman
requested changes
Apr 19, 2026
Member
There was a problem hiding this comment.
I don't think this is the right fix. I'll comment on the original issue.
Update: It's too harsh to say this isn't the right fix; it's probably a valid fix given the current issues with ibis.FileDataset. I still think converting to Path instead of str should also work and be more aligned with the existing code, but really anything is a stopgap until resolve #1298.
deepyaman
reviewed
Apr 20, 2026
|
|
||
| def load(self) -> ir.Table: | ||
| load_path = self._get_load_path() | ||
| load_path = str(self._get_load_path()) |
Member
There was a problem hiding this comment.
Suggested change
| load_path = str(self._get_load_path()) | |
| load_path = Path(self._get_load_path()) |
| Path(save_path).parent.mkdir(parents=True, exist_ok=True) | ||
| writer = getattr(self.connection, f"to_{self._file_format}") | ||
| writer(data, save_path, **self._save_args) | ||
| writer(data, str(save_path), **self._save_args) |
Member
There was a problem hiding this comment.
Suggested change
| writer(data, str(save_path), **self._save_args) | |
| writer(data, save_path, **self._save_args) |
Comment on lines
162
to
163
| save_path = self._get_save_path() | ||
| Path(save_path).parent.mkdir(parents=True, exist_ok=True) |
Member
There was a problem hiding this comment.
Suggested change
| save_path = self._get_save_path() | |
| Path(save_path).parent.mkdir(parents=True, exist_ok=True) | |
| save_path = Path(self._get_save_path()) | |
| save_path.parent.mkdir(parents=True, exist_ok=True) |
For a temporary workaround, maybe the set of proposed suggestions is also fine?
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.
Description
Fix for #1378.
ibis.FileDatasetpasses PurePosixPath objects directly to ibis backend reader/writer methods. The Polars backend'sread_parquetinternally callslen()on the path argument (to distinguish a single path from a list of paths), which fails because PurePosixPath has no such method:Explicitly converted load and save paths to str before passing them to the backend. This is the lowest-common-denominator type accepted by all ibis backends and aligns with the workaround suggested by the community member who reported the issue.
Development notes
Developer Certificate of Origin
We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a
Signed-off-byline in the commit message. See our wiki for guidance.If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.
Checklist
jsonschema/kedro-catalog-X.XX.jsonif necessaryRELEASE.mdfile