feat(datasets): add os.PathLike support for Text, JSON, YAML and Pickle datasets#1324
Merged
merelcht merged 2 commits intokedro-org:mainfrom Feb 27, 2026
Conversation
…le datasets Update filepath type hints from `str` to `str | os.PathLike` in TextDataset, JSONDataset, YAMLDataset, and PickleDataset, and add `test_pathlike_filepath` tests to verify that pathlib.Path objects can be passed directly without calling `.as_posix()`. Closes part of kedro-org#1316 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Priyanka Ojha <21082240+priya-gitTest@users.noreply.github.com>
74c6ac2 to
4459e85
Compare
merelcht
approved these changes
Feb 27, 2026
Member
merelcht
left a comment
There was a problem hiding this comment.
Thank you so much for the contribution @priya-gitTest ! ⭐
ravi-kumar-pilla
approved these changes
Feb 27, 2026
Contributor
ravi-kumar-pilla
left a comment
There was a problem hiding this comment.
Thank you for the contribution @priya-gitTest . The changes look clean 💯
28 tasks
Open
28 tasks
6 tasks
6 tasks
celinaczy
pushed a commit
to celinaczy/kedro-plugins-fork
that referenced
this pull request
Feb 27, 2026
…le datasets (kedro-org#1324) Update filepath type hints from `str` to `str | os.PathLike` in TextDataset, JSONDataset, YAMLDataset, and PickleDataset, and add `test_pathlike_filepath` tests to verify that pathlib.Path objects can be passed directly without calling `.as_posix()`. Closes part of kedro-org#1316 Signed-off-by: Priyanka Ojha <21082240+priya-gitTest@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: celina-czyszczon <celina.czyszczon@justeattakeaway.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.
Closes part of #1316.
Updates the
filepathtype hint fromstrtostr | os.PathLikefor:TextDatasetJSONDatasetYAMLDatasetPickleDatasetAdds a
test_pathlike_filepathtest to each dataset's test suite thatpasses a
pathlib.Pathobject directly (without.as_posix()) andverifies a save/load round-trip works correctly.
Notes
The underlying
get_protocol_and_pathfromkedro.io.corealreadyaccepts
str | os.PathLike, so no changes to core logic were needed —only the public type hints and tests.