Open MarcoGorelli opened 3 hours ago
in accordance with the stability principle, the idea would be to:
pass_through
alongside strict
nw.from_native
raises a DeprecationWarning
if strict
is passed, whereas nw.stable.v1
doesn'tworking on this,
Context: in both the Plotly and the Altair PRs, some maintainers expressed some surprised at what
strict=False
doesPolars does have
strict
parameter in a few places, but it doesn't exactly match ours infrom_native
:strict=True
, both Narwhals.from_native and Polars' Series constructor raisestrict=False
, then in Polars, non-coercible types are set tonull
, whereas innarwhals.from_native
we just pass things through unchangedSo,
pass_through
is probably a better nameAn alternative would be to be to just make it strict by default and let people do
try-except
, but tbh I'm not a huge fan of encouraging try-except, it's kinda error-prone, and it's easy to think you're catching one error but are actually catching another one entirely