Open
Conversation
在使用duckdb的时候,发现oss://xxx/xxx.xx形式格式,总是找不到文件。调试发现,在调用ossfs的info方法的时候,会进入到fsspec的父类AbstractFileSystem中的info方法中。如果传入原始输入的path,会出现明明获得了文件信息,但是执行[o for o in out if o["name"].rstrip("/") == path]这一行的时候,找不到文件,从而返回错误的文件信息,进而读不到文件。
ossfs的info方法中,已经获得了去除协议头和正斜杠的norm_path,把其传入AbstractFileSystem中的info方法中,可以获得正确的结果
skshetry
reviewed
Jan 29, 2025
| result = {"name": path, "size": 0, "type": "directory"} | ||
| else: | ||
| result = super().info(path, **kwargs) | ||
| result = super().info(norm_path, **kwargs) |
Collaborator
There was a problem hiding this comment.
Is that [o for o in out if o["name"].rstrip("/") == path] not finding path in fsspec.AbstractFileSystem because of the lstrip above?
Author
There was a problem hiding this comment.
It seems to be the reason, but it's been too long and I forgot, sorry.
skshetry
approved these changes
Jan 29, 2025
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.
在使用duckdb的时候,发现oss://xxx/xxx.xx形式格式,总是找不到文件。调试发现,在调用ossfs的info方法的时候,会进入到fsspec的父类AbstractFileSystem中的info方法中。如果传入原始输入的path,会出现明明获得了文件信息,但是执行[o for o in out if o["name"].rstrip("/") == path]这一行的时候,找不到文件,从而返回错误的文件信息,进而读不到文件。 ossfs的info方法中,已经获得了去除协议头和正斜杠的norm_path,把其传入AbstractFileSystem中的info方法中,可以获得正确的结果