abstractqqq / polars_istr

Identifiers and Standard Format Parsing for Polars Dataframe
MIT License
12 stars 1 forks source link

Package polars dependencies are not aligned #15

Open ion-elgreco opened 3 months ago

ion-elgreco commented 3 months ago

Errors out with polars==0.20.10

File [~/.venv/lib/python3.11/site-packages/polars_istr/_utils.py:30](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/ion//~/.venv/lib/python3.11/site-packages/polars_istr/_utils.py:30), in pl_plugin(lib, symbol, args, kwargs, is_elementwise, returns_scalar, changes_length, cast_to_supertype)
     27 if tuple(int(x) for x in pl.__version__.split(".")) < (0, 20, 16):
     28     # This will eventually be deprecated?
     29     first = str_to_expr(args[0])
---> 30     return first.register_plugin(
     31         lib=lib,
     32         symbol=symbol,
     33         args=[str_to_expr(x) for x in args[1:]],
     34         kwargs=kwargs,
     35         is_elementwise=is_elementwise,
     36         returns_scalar=returns_scalar,
     37         changes_length=changes_length,
     38         cast_to_supertype=cast_to_supertype,
     39     )
     41 from polars.plugins import register_plugin_function
     43 return register_plugin_function(
     44     plugin_path=lib,
     45     args=[str_to_expr(x) for x in args],
   (...)
     51     cast_to_supertype=cast_to_supertype,
     52 )

TypeError: Expr.register_plugin() got an unexpected keyword argument 'cast_to_supertype'
abstractqqq commented 3 months ago

Apparently if we do expr.register_plugin, the argument's name is cast_to_supertypes, and if we do register_plugin_function, then it is cast_to_supertype without the s lol! Thanks for point it out!

ion-elgreco commented 3 months ago

@abstractqqq damn haha