Skip to content

Fix storage options nested under the outermost protocol - #567

Open
Laurent2916 wants to merge 2 commits into
fsspec:mainfrom
Laurent2916:fix-outermost-chain-storage-options
Open

Laurent2916 wants to merge 2 commits into
fsspec:mainfrom
Laurent2916:fix-outermost-chain-storage-options

Conversation

@Laurent2916

Copy link
Copy Markdown

Closes #566

FSSpecChainParser.unchain popped the options nested under the first protocol before merging in the user's storage options, so it never found them. This merges them into the flat options first, with flat options taking precedence, like fsspec.core._un_chain.

Because this matches fsspec, a urlpath without :: changes too: UPath("memory://a", memory={...}) now unpacks the dict.

Drafted with the help of an AI assistant.

fsspec.core.url_to_fs takes options nested under the protocol of every
filesystem of a urlpath, the outermost one included. UPath keeps the
outermost dict as a literal key and ignores it.
FSSpecChainParser.unchain popped the options nested under the first
protocol before merging in the flat storage options, so the pop never
found them. Merge them first, and let flat options take precedence,
like fsspec.core._un_chain.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Options passed under the outermost protocol of a chained URL are silently ignored

1 participant