Skip to content

feat(bindings/python): accept PathLike constructor options - #6490

Merged
Xuanwo merged 9 commits into
mainfrom
root-path
Nov 1, 2026
Merged

Xuanwo merged 9 commits into
mainfrom
root-path

Conversation

@asukaminato0721

@asukaminato0721 asukaminato0721 commented Aug 7, 2025 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #6479.

Rationale for this change

Passing pathlib.Path as root raises TypeError in the Python operator constructors because keyword values must be strings.

What changes are included in this PR?

Both Operator and AsyncOperator accept strings and path-like keyword values whose os.fspath() result is a string. The constructor annotations and docstrings describe PathLike[str]. Regression tests exercise synchronous and asynchronous Fs writes and reads with string and Path roots, and reject bool and bytes values.

Validation on Nier: 19 focused constructor, from_config, and from_uri cases against the newly built native extension, plus Rust and Python quality checks and regenerated-stub consistency.

Are there any user-facing changes?

Callers can pass pathlib.Path and other PathLike[str] values directly to either constructor.

Breaking changes

AI Usage Statement

  • Harness: Codex desktop. Model: gpt-6.1-sol. Effort: max. Role: constructor implementation, regression tests, and integration.
  • Harness: Codex subagent. Model: group/deepseek (underlying model version is not exposed). Effort: max. Role: independent source review and validation on Nier.

@asukaminato0721 asukaminato0721 changed the title try fix feat(bindings/python): allow Path in root Aug 7, 2025
@asukaminato0721

Copy link
Copy Markdown
Contributor Author

ohh, the new clippy warning, I don't want to fix them in this pr.

@asukaminato0721

Copy link
Copy Markdown
Contributor Author

tests/test_operator_construction.py::test_operator_new_with_path PASS

@asukaminato0721
asukaminato0721 marked this pull request as ready for review August 7, 2025 18:15
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Aug 7, 2025
@asukaminato0721 asukaminato0721 self-assigned this Aug 7, 2025
@kingsword09

Copy link
Copy Markdown
Member

ohh, the new clippy warning, I don't want to fix them in this pr.

This has already been resolved and merged into main.

Comment thread bindings/python/src/operator.rs Resolved
@asukaminato0721

Copy link
Copy Markdown
Contributor Author
PyErr { type: <class 'TypeError'>, value: TypeError("'PosixPath' object cannot be converted to 'PyString'"), traceback: None }

Need some fix.

@github-actions github-actions Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 1, 2026
@Xuanwo Xuanwo changed the title feat(bindings/python): allow Path in root feat(bindings/python): accept PathLike constructor options Nov 1, 2026
@Xuanwo
Xuanwo merged commit a7b9def into main Nov 1, 2026
92 checks passed
@Xuanwo
Xuanwo deleted the root-path branch November 1, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bindings/python releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: Python should accept Path for root argument

4 participants