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

improve docstrings in stages and operators #59

Open
VianneyMI opened this issue Aug 10, 2023 · 7 comments
Open

improve docstrings in stages and operators #59

VianneyMI opened this issue Aug 10, 2023 · 7 comments
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@VianneyMI
Copy link
Owner

VianneyMI commented Aug 10, 2023

  • Copy what was done later on when interfacing Atlas Search. That is adding a description of the operator/stage
  • Add link to official mongo doc
@VianneyMI VianneyMI added the documentation Improvements or additions to documentation label Aug 10, 2023
@VianneyMI VianneyMI self-assigned this Aug 10, 2023
@VianneyMI
Copy link
Owner Author

@VianneyMI VianneyMI added the good first issue Good for newcomers label Sep 15, 2023
@VianneyMI VianneyMI changed the title improves docstrings in stages and operators improve docstrings in stages and operators Sep 22, 2023
@VianneyMI VianneyMI assigned OlivierLegrand and unassigned VianneyMI Nov 1, 2023
VianneyMI added a commit that referenced this issue Nov 21, 2023
@VianneyMI
Copy link
Owner Author

@VianneyMI
Copy link
Owner Author

@OlivierLegrand
Copy link
Collaborator

OlivierLegrand commented Mar 29, 2024

  • merge 59 dans 59 bis
  • finish 59 bis

@OlivierLegrand
Copy link
Collaborator

In pipeline.py:

  • in replace_root and replace_with methods docstrings: "For more info on expressions, see Expressions." Where this should point to? There is no link atm but I think there should be one?
  • in all method docstrings: "Adds a ... stage to the current pipeline": should it be the monggregate stage or its MongoDB counterpart (when it exists) ? For instance, in search_meta: should it be "Adds a search_meta stage..." or "Adds a searchMeta stage..." or "Adds a $searchMeta stage...".
  • Same question in set stage. Currently, it is a mix of both:

Adds a set stage to the current pipeline. Adds new fields to documents. $set outputs documents that contain all existing fields from the inputs documents and newly added fields. Both stages are equivalent to a $project stage that explicitly specifies all existing fields in the inputs documents and adds the new fields.

@OlivierLegrand
Copy link
Collaborator

Made the following changes in pipeline.py:

  • In the Examples section of the pipeline class doctoring, changed

Examples
--------
You can instantiate a pipeline instance as follow:

    >>> pipeline = Pipeline(collection="listingsAndReviews") # collection is the only mandatory attribute 
                                                            # [example using MongoDB AirBnB demo dataset](https://www.mongodb.com/docs/atlas/sample-data/sample-airbnb/#std-label-sample-airbnb)
and then add stages to the pipeline by calling its wrapper stages method as shown below:

to

Examples
--------
The following examples use the example using MongoDB AirBnB demo dataset.

You can instantiate a pipeline instance as follow:

    >>> pipeline = Pipeline(collection="listingsAndReviews") # collection is the only mandatory attribute 

and then add stages to the pipeline by calling its wrapper stages method as shown below:

for a better rendering.

@OlivierLegrand
Copy link
Collaborator

  • virer expression partout (pipeline et stages)
  • séparer dans la doc de pipeline les méthodes associées aux stages, et les autres. (les grouper ensemble)
  • mettre privé tout ce qui est décoré par pyd.validator (n'apparaîtra plus dans la doc)
  • faire une PR
  • quand la PR est validée, recréer une nouvelle branche à partir de l'issue.

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 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants
@VianneyMI @OlivierLegrand and others