-
Notifications
You must be signed in to change notification settings - Fork 211
perf: make to_py_scalar 3x faster when argument is str #1276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,10 @@ def test_stable_api_docstrings() -> None: | |
| nw_doc = getattr(nw, item).__doc__ | ||
| if item == "from_native": | ||
| v1_doc = v1_doc.replace("native_dataframe", "native_object") | ||
| if item in {"to_py_scalar"}: | ||
| # We don't overwrite the docstring for these | ||
|
Comment on lines
+90
to
+91
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just so I know what to do/review in the future, which kind of methods should be added here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all of them to be honest, it's probably simpler to just use |
||
| assert v1_doc == nw_doc | ||
| continue | ||
| assert ( | ||
| v1_doc.replace("import narwhals.stable.v1 as nw", "import narwhals as nw") | ||
| == nw_doc | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of related, I am running a test, and getting a raise if None enters this function. Should we add it to non temporal scalar types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good point, thanks!