feat: Extend plugin support for IO and from_* methods/functions#3753
feat: Extend plugin support for IO and from_* methods/functions#3753FBruzzesi wants to merge 7 commits into
from_* methods/functions#3753Conversation
|
Hey @FBruzzesi, just thought I'd share this here as I hinted at something I did in Important I'm not saying you need to do this, just inspiration if you want it ExamplesSo here's a breakdown ...
|
| assert s.scatter(1, 50).to_native() == [1, 50, 3] | ||
| # Original Series is unchanged, and empty indices are a no-op. | ||
| assert s.to_native() == [1, 2, 3] |
There was a problem hiding this comment.
nice, thanks for testing this
|
Thanks both! @dangotbanned I think the implementation is not too far from what you have implemented, yet the machinery we have here is different. |

Description
The core changes are in the
eager_namespacefor the backend resolution logic, which allows forbackend=arguments to resolve for Narwhals plugins: users can pass a plugin's entry point name, module name, or the module itself.{read,scan}_{csv,parquet}dispatch to same-named top-level plugin hooks.from_*,new_series,DataFrame.from_*,Series.from_*) work with zero extra plugin code if the plugin's compliant namespace implements theEagerNamespaceprotocol.Most of the lines changes are in
packages/test-pluginandtests/plugins_test.pyso that we have coverage for the functionalities.What type of PR is this? (check all applicable)
Related issues
scan_csvfor plugins #3713Implementationfor plugins #3042: thenarwhals.pluginsentry-point group is the registration mechanism we have. Not sure we can do much more than this dispatching