-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-40342: [C++] move LocalFileSystem to the registry #40356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ca25b8e to
1f5e319
Compare
1f5e319 to
7e74b80
Compare
fd4de2a to
211b82e
Compare
jorisvandenbossche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python changes look good to me
211b82e to
320e4d5
Compare
be4468a to
46758bc
Compare
cpp/src/arrow/filesystem/localfs.cc
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? The local scheme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed more inconsistent to refuse the scheme since the type_name() of other filesystems is also a usable scheme. I can remove it
|
The only failures are a known flake #40675 |
) ### Rationale for this change Moving LocalFileSystem into the registry is a good first usage and will help us hammer out which aspects of built in file systems should remain public. ### What changes are included in this PR? A factory for LocalFileSystem is added to the registry. `FileSystem::MakeUri` ( apache#18316 ) is added to enable roundtripping filesystems through URIs. `file://` URIs now support a use_mmap query parameter, and `local://` URIs are also supported as an alias. <h6 id="reduce">Reducing the set of bound classes</h6> Some unnecessary bindings to the LocalFileSystem concrete class are removed. This demonstrates that with a registered factory pattern, it is no longer necessary to keep a class hierarchy public for binding. Eventually (if desired), we can move concrete subclasses of FileSystem entirely out of public headers. ### Are these changes tested? Yes, all existing tests for file:// URIs continue to pass ### Are there any user-facing changes? For consistency, local:// URIs will now be considered equivalent to corresponding file:// URIs * GitHub Issue: apache#40342 Authored-by: Benjamin Kietzman <[email protected]> Signed-off-by: Benjamin Kietzman <[email protected]>
|
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit fd75cbd. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 45 possible false positives for unstable benchmarks that are known to sometimes produce them. |
| @staticmethod | ||
| @binding(True) # Required for cython < 3 | ||
| def _reconstruct(kwargs): | ||
| # __reduce__ doesn't allow passing named arguments directly to the | ||
| # reconstructor, hence this wrapper. | ||
| return LocalFileSystem(**kwargs) | ||
|
|
||
| def __reduce__(self): | ||
| cdef CLocalFileSystemOptions opts = self.localfs.options() | ||
| return LocalFileSystem._reconstruct, (dict( | ||
| use_mmap=opts.use_mmap),) | ||
| uri = frombytes(GetResultValue(self.fs.MakeUri(b"/_"))) | ||
| return FileSystem._from_uri, (uri,) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactoring this has broken the cython-2 build (as the removed comments indicated, that code was required for cython < 3)
(TBH, I would personally also fine with just dropping that build and requiring cython > 3 for building)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #41459 for a quick fix for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, sorry
Small follow-up fix for the failure introduced by #40356 * GitHub Issue: #40342 Authored-by: Joris Van den Bossche <[email protected]> Signed-off-by: Joris Van den Bossche <[email protected]>
) ### Rationale for this change Moving LocalFileSystem into the registry is a good first usage and will help us hammer out which aspects of built in file systems should remain public. ### What changes are included in this PR? A factory for LocalFileSystem is added to the registry. `FileSystem::MakeUri` ( apache#18316 ) is added to enable roundtripping filesystems through URIs. `file://` URIs now support a use_mmap query parameter, and `local://` URIs are also supported as an alias. <h6 id="reduce">Reducing the set of bound classes</h6> Some unnecessary bindings to the LocalFileSystem concrete class are removed. This demonstrates that with a registered factory pattern, it is no longer necessary to keep a class hierarchy public for binding. Eventually (if desired), we can move concrete subclasses of FileSystem entirely out of public headers. ### Are these changes tested? Yes, all existing tests for file:// URIs continue to pass ### Are there any user-facing changes? For consistency, local:// URIs will now be considered equivalent to corresponding file:// URIs * GitHub Issue: apache#40342 Authored-by: Benjamin Kietzman <[email protected]> Signed-off-by: Benjamin Kietzman <[email protected]>
…apache#41459) Small follow-up fix for the failure introduced by apache#40356 * GitHub Issue: apache#40342 Authored-by: Joris Van den Bossche <[email protected]> Signed-off-by: Joris Van den Bossche <[email protected]>
Rationale for this change
Moving LocalFileSystem into the registry is a good first usage and will help us hammer out which aspects of built in file systems should remain public.
What changes are included in this PR?
A factory for LocalFileSystem is added to the registry.
FileSystem::MakeUri( #18316 ) is added to enable roundtripping filesystems through URIs.file://URIs now support a use_mmap query parameter, andlocal://URIs are also supported as an alias.Reducing the set of bound classes
Some unnecessary bindings to the LocalFileSystem concrete class are removed. This demonstrates that with a registered factory pattern, it is no longer necessary to keep a class hierarchy public for binding. Eventually (if desired), we can move concrete subclasses of FileSystem entirely out of public headers.
Are these changes tested?
Yes, all existing tests for file:// URIs continue to pass
Are there any user-facing changes?
For consistency, local:// URIs will now be considered equivalent to corresponding file:// URIs