Skip to content

[FIX] fs_storage: Add a KeyError Exception#457

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
dixmit:16.0-add-keyError
Mar 11, 2025
Merged

[FIX] fs_storage: Add a KeyError Exception#457
OCA-git-bot merged 1 commit intoOCA:16.0from
dixmit:16.0-add-keyError

Conversation

@etobella
Copy link
Copy Markdown
Member

@etobella etobella commented Mar 11, 2025

This is necessary in order to avoid issues in case fsspec added a new protocol and forget the error key

Without this change, edi-framework and storage are failing (and other tests might happen too).

The real error is here:

https://github.com/fsspec/filesystem_spec/blame/50c5a2e161d85413e19e9e10d42de8b3cf56a921/fsspec/registry.py#L75-L77

An err key should be added, but it was forgotten. I created a PR in fsspec in order to fix it, but I think we can add this in order to avoid other errors.

fsspec/filesystem_spec#1804

@lmignon @simahawk

@etobella etobella force-pushed the 16.0-add-keyError branch from deb6c92 to 6ae989e Compare March 11, 2025 09:33
Copy link
Copy Markdown

@kluna1998 kluna1998 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍🏽

Comment thread fs_storage/models/fs_storage.py Outdated
@etobella etobella force-pushed the 16.0-add-keyError branch from 6ae989e to ad8f2b3 Compare March 11, 2025 09:45
Copy link
Copy Markdown

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Contributor

@lmignon lmignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to circumvent a bug into the lib or can we just avoid to use the dependency's version of fsspec introducing the bug as proposed in #455

@etobella
Copy link
Copy Markdown
Member Author

Well, I will use this PR in my internal implementations for sure with gitaggregate... once the library is fixed we will not need it anymore probably. Enforcing the library might work locally, but might give problems in other systems (it implies that everyone checks the dependencies on their projects and force the right one)

@baguenth
Copy link
Copy Markdown
Member

I raised #455 but actually think, that the solution proposed here is more general.

@lmignon
Copy link
Copy Markdown
Contributor

lmignon commented Mar 11, 2025

I raised #455 but actually think, that the solution proposed here is more general.

If we want a more general solution we should catch all 'Exception' instances to avoid to add another kind of exception in the future for not yet known error...

Copy link
Copy Markdown
Contributor

@lmignon lmignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching the ImportError is not the right approach since it assume that the implementation will always raise this kind of exception when it's not possible to load a specific protocol. Any exception occurring at this stage has the same consequence.... the protocol can't be loaded

Comment thread fs_storage/models/fs_storage.py Outdated
Comment thread fs_storage/models/fs_storage.py Outdated
This is necessary in order to avoid issues in case fsspec added a new protocol and forget the error key
@etobella etobella force-pushed the 16.0-add-keyError branch from ad8f2b3 to dc07e5b Compare March 11, 2025 14:24
@lmignon
Copy link
Copy Markdown
Contributor

lmignon commented Mar 11, 2025

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-457-by-lmignon-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at c076c4b. Thanks a lot for contributing to OCA. ❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants