narwhals-dev / narwhals

Lightweight and extensible compatibility layer between dataframe libraries!
https://narwhals-dev.github.io/narwhals/
MIT License
607 stars 90 forks source link

[Doc]: Clarify behavior of boolean arguments to `from_native()` #1420

Closed emilykl closed 2 hours ago

emilykl commented 18 hours ago

What type of report is this?

Improvement

Please describe the issue.

While consulting the docs today I noticed that the behavior of the boolean arguments to from_native() is not fully explained, particularly since None is one of the allowed values, and most of the arguments default to None, so it's unclear what is the default behavior./

The explanation for pass_through is nearly there, since it clearly explains the behavior in the True and False cases, but it doesn't explain the behavior in the None case. (I notice that the explanation says that True is the default even though the value listed under the "Default" column is None -- maybe the values in the "Default" column are just incorrect?)

If you have a suggestion on how it should be, add it below.

For each boolean argument, docs should explain:

Screenshot of relevant portion of docs

Screen Shot 2024-11-21 at 6 11 21 PM
MarcoGorelli commented 8 hours ago

Thanks @emilykl for the report!

Agree that these need documenting exhaustively - PR incoming

I'm also hoping we can find a way to not show all the overloads in the docstring https://github.com/mkdocstrings/mkdocstrings/issues/716

Related, I'm not super-proud of from_native, I think it does too much, and think we can design something better for when we get to stable.v2