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

Add missing docstring examples #13161

Closed
braaannigan opened this issue Dec 20, 2023 · 22 comments
Closed

Add missing docstring examples #13161

braaannigan opened this issue Dec 20, 2023 · 22 comments
Labels
accepted Ready for implementation documentation Improvements or additions to documentation

Comments

@braaannigan
Copy link
Collaborator

Description

Some of the methods lack any API examples. The attached CSV shows a list of function urls that do not currently have examples: has_examples.csv

This is a really good first issue. Some of these methods - such as the I/O methods - are more advanced but there are plenty of simpler expression and series methods there are good for new contributors. If anyone wants to have a go please reply to this issue saying which group of methods you are working on. It is best to do small PRs with just a few methods at a time.

If anyone is having trouble with the contribution process @ me here (or on discord which I see more easily)

Link

No response

@braaannigan braaannigan added documentation Improvements or additions to documentation good first issue Good for newcomers labels Dec 20, 2023
@stinodego
Copy link
Member

Please refer to our contributing guide for guidance on writing good doc examples:
https://pola-rs.github.io/polars/development/contributing/test/#writing-doc-examples

@stinodego stinodego added the accepted Ready for implementation label Dec 20, 2023
@stinodego stinodego changed the title Missing docstring examples Add missing docstring examples Dec 20, 2023
@braaannigan
Copy link
Collaborator Author

@stinodego Was thinking I should break the missing examples into more manageable chunks with an issue each, what do you think?

@stinodego
Copy link
Member

I don't think that's necessary. If people want to contribute docstring examples, this issue is sufficient to find out where the gaps are.

@deanm0000
Copy link
Collaborator

Should the file be called needs_examples instead of has_examples? I noticed there's a lot of Series methods on there that probably have Expr methods. Is there an automated way to put a link on the Series method to the Expr method for near examples? Also the list has a lot of deprecated methods that shouldn't have examples. The pages that are deprecated have a div class="deprecated" to make automated filtering easier.

@r-brink
Copy link
Contributor

r-brink commented Dec 24, 2023

This looks like a fun one to familiarise myself again with the contribution process. I'll have a look at the csv file and update here if when I started working on a batch

@jcrozum
Copy link
Contributor

jcrozum commented Jan 6, 2024

I would like to work on this, starting with the datetime functions.

Examples are not desired for deprecated functions, correct? I will skip these to start, but can always add them later.

Also, it looks like many of these functions now have examples. I can update the list.

@MarcoGorelli
Copy link
Collaborator

great to see the community effort!

I'd suggest skipping anything deprecated

@jcrozum
Copy link
Contributor

jcrozum commented Jan 6, 2024

I updated the list of missing examples below.
removed_from_needed_examples_list.csv
updated_missing_examples_list.csv

@tim-stephenson
Copy link
Contributor

@MarcNuebel
Copy link
Contributor

@jmgonzalezro
Copy link

How can I contribute? Just downloading the csv, checking what the fucntions pending do, and creating docstrings into the functions? First timmer here.

@r-brink
Copy link
Contributor

r-brink commented Jan 9, 2024

I just opened a PR to add more examples to the docs. See below for the ones I added.

Here the updated overview. I also removed read_csv

updated_missing_examples_list_09012024.csv

NOTE: some of the examples above where already added and merged, but not mentioned here.

@r-brink
Copy link
Contributor

r-brink commented Jan 9, 2024

How can I contribute? Just downloading the csv, checking what the fucntions pending do, and creating docstrings into the functions? First timmer here.

@jmgonzalezro Have a look at the remaining docstrings that are missing an example. I just shared an updated overview. Pick the ones you want to work on and have fun. The contribution guide can help you set up your environment and create a PR: https://docs.pola.rs/development/contributing/

MarcNuebel added a commit to MarcNuebel/polars that referenced this issue Jan 9, 2024
MarcNuebel added a commit to MarcNuebel/polars that referenced this issue Jan 9, 2024
Addition to pola-rs#13545 with unnecessary doctest skips removed.
Part of pola-rs#13161.
@mbuhidar
Copy link
Contributor

Created a PR to improve formatting for Series.binary.encode and Series.binary.decode examples. Also added an example case for Series.binary.decode with the strict parameter set to False.

@montanarograziano
Copy link
Contributor

@montanarograziano
Copy link
Contributor

Added a few more examples in this PR.

I removed these from the csv and also cleaned entries already resolved.
Here' the updated version:
missing_docstrings_updated.csv
I've noticed that for all the entries regarding types, (example: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.Float64.html) the link is broken: does it refer to https://docs.pola.rs/py-polars/html/reference/api/polars.datatypes.Int64.html?
If so, which kind of examples are expected? Thank you!

@stinodego stinodego removed the good first issue Good for newcomers label Jun 10, 2024
@stinodego
Copy link
Member

I'm going to close this one as we're pretty much fully covered at this point.

There are a few entries left over where it's not exactly clear how to best give examples, e.g. DataType classes or I/O functionality. We can look at those separately.

Thanks to everyone who has contributed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation documentation Improvements or additions to documentation
Projects
Archived in project
Development

No branches or pull requests