Skip to content
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

docs(python): Clarify explanation and examples for .eq_missing #17003

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bertiewooster
Copy link
Contributor

Fixes #16867 with explanation proposed by @mcrumiller. Provides examples that .eq_missing() will return False whether the number is on the left (the Expr) or right (the other parameter) when the other value is None. For documentation page https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.eq_missing.html.

@bertiewooster
Copy link
Contributor Author

The test failure seems unrelated to the change in this PR; the failure is in Run Python tests - async reader

tests/unit/io/test_file_cache.py:54: in test_file_cache_ttl
    assert [x.exists() for x in metadata_file_paths] == [True, False]
E   assert [True, True] == [True, False]

@stinodego stinodego changed the title Clarify explanation and examples for .eq_missing() docs(python): Clarify explanation and examples for .eq_missing() Jun 17, 2024
@stinodego stinodego changed the title docs(python): Clarify explanation and examples for .eq_missing() docs(python): Clarify explanation and examples for .eq_missing Jun 17, 2024
@github-actions github-actions bot added documentation Improvements or additions to documentation python Related to Python Polars labels Jun 17, 2024
@coastalwhite
Copy link
Collaborator

Could you rebase this onto the main branch. I am pretty sure, it will pass the CI if you do that.

Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you also update Series.eq_missing?

py-polars/polars/expr/expr.py Outdated Show resolved Hide resolved
py-polars/polars/expr/expr.py Show resolved Hide resolved
py-polars/polars/expr/expr.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.86%. Comparing base (235ebee) to head (dfa4485).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17003   +/-   ##
=======================================
  Coverage   80.86%   80.86%           
=======================================
  Files        1455     1455           
  Lines      191086   191093    +7     
  Branches     2723     2724    +1     
=======================================
+ Hits       154519   154525    +6     
- Misses      36063    36064    +1     
  Partials      504      504           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bertiewooster
Copy link
Contributor Author

Could you rebase this onto the main branch. I am pretty sure, it will pass the CI if you do that.

That worked. Thanks!

bertiewooster and others added 2 commits June 19, 2024 11:26
In py-polars/polars/expr/expr.py

Co-authored-by: Stijn de Gooijer <[email protected]>
@bertiewooster
Copy link
Contributor Author

bertiewooster commented Jun 19, 2024

Thanks! Could you also update Series.eq_missing?

@stinodego I'm happy to do, but...

The pages for Series.eq and Series.eq_missing don't seem to exist: stubs exist on the Series page, but they are not hyperlinked (not underlinked in the screenshot below). Also, searching the docs for eq_missing doesn't find a Series method page. In fact, it seems like the entire Operators section for Series does not exist: ge, gt, ne, etc. are also missing. (The links I gave are for the dev docs; same results on the stable and v1 docs.)

So I don't think I'll be able to check the results (a web page built by Sphinx) of updating the Series.eq_missing docstring, correct?

If that's correct, perhaps I should hold off for now and do a separate PR when the Series.eq_missing page exists?

Series methods eq and eq_missing lack hyperlinks

@stinodego
Copy link
Member

The pages for Series.eq and Series.eq_missing don't seem to exist

Oops, good catch. I added them :)

@bertiewooster
Copy link
Contributor Author

Great, the Series Operators pages now exist. And I made the analogous changes to the Series.eq_missing docstring, both description and Examples.

@bertiewooster
Copy link
Contributor Author

@stinodego Could this PR be merged so the Series Operators section's pages will be added (they're still missing in the 1.0 docs), and .eq_missing will be improved? I addressed your requested changes by updating Series.eq_missing. Thanks!

@DeflateAwning
Copy link
Contributor

What's needed here? The ambiguity solved here came up in a discussion among core maintainers in #18728 again here.

I can try to help with code changes if there's anything remaining here. Otherwise, @mcrumiller or @cmdlineluser, while these discussions are fresh, maybe you can check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add to .eq_missing() a comment about what happens in the case of Null.eq_missing(Number)
5 participants