aai-institute / lakefs-spec

An fsspec implementation for the lakeFS project
http://lakefs-spec.org/
Apache License 2.0
39 stars 4 forks source link

Add doc-strings to the client_helpers #168

Closed maxmynter closed 11 months ago

maxmynter commented 12 months ago

Add doc strings such that the client_helpers API are included in the documentation.

This addresses https://github.com/aai-institute/lakefs-spec/issues/121

The question remains open whether we want doc-strings (and hence documentation) on all the members where I added them. Some might not be intended as public API. Refer to the linked issue for more details.

janwillemkl commented 12 months ago

For the parameter descriptions, there is some inconsistency:

For example:

In principle it is also not needed to include the type in the description, because that information is already present in definition.

AdrianoKF commented 11 months ago

I took the liberty of answering a few of your questions by means of pushing a reformatting of the docstrings 😅 (without seeing your comments)

* What is the policy on the introductory sentence in the docstring re: linebreak after the multiline intro `"""`?

* Do we want to explicitly mention what the default is in argument descriptions, even if it's in the signature?

Arguable, but I lean towards omitting them (if the rendered docs show the defaults correctly - which it seems they do).

* What tense / grammatical case are we putting the synopses into? I would argue for imperative (example: `Merge branch xyz`) instead of 3rd person (`Merges branch xyz`).

I don't care either way, but agree with what the Google Python style guide has to say on the matter:

The docstring may be descriptive-style ("""Fetches rows from a Bigtable.""") or imperative-style ("""Fetch rows from a Bigtable."""), but the style should be consistent within a file.

* Do we give names and types to the return values in the `Returns` section? I think we just went with a one sentence-description so far (names are not really valuable anyway, since the user will assign the name by himself).

No names, IMO (in fact I edited them out)


A few general remarks, @maxmynter:

I also added a watch block to mkdocs.yml for the source folder to make editing docstrings easier (since mkdocs serve will automatically rebuild the docs when saving a changed source file).

AdrianoKF commented 11 months ago

Merging now, as these can always be improved later on.