dask icon indicating copy to clipboard operation
dask copied to clipboard

API docs missing for `read_csv`, `read_fwf` and `read_table`

Open fjetter opened this issue 1 year ago • 3 comments

I believe there are still plenty of doc strings missing since the dask-expr migration

For example https://docs.dask.org/en/latest/generated/dask_expr.read_csv.html

image

fjetter avatar May 15 '24 09:05 fjetter

Hello @fjetter - hope you're having a wonderful day!

I'd love to assist here - this would be my first ever PR, how should I help update these doc strings (aka is there a template I can follow)?

Would love to help!

joehiggi1758 avatar May 19 '24 04:05 joehiggi1758

A couple of things here.

First of all, this issue is actually a bit more work than I initially anticipated. A while ago we migrated to a new dataframe backend using https://github.com/dask/dask-expr We had to move over a couple of different doc strings, see for example https://github.com/dask/dask-expr/pull/1051. These doc strings should also has to be added in that repo.

The original docs for read_csv, read_fwf and read_table where actually auto generated using a template, see READ_DOC_TEMPLATE

I suspect we can use the same template but will require a slightly different mechanism. I suspect adding

read_csv.__doc__ = READ_DOC_TEMPLATE.format(reader="read_csv", file_type="CSV")

and similar for FWF and table should do the trick. (See here where the legacy readers are defined)

fjetter avatar May 21 '24 10:05 fjetter

@fjetter sounds great I'll take a crack at it!

joehiggi1758 avatar May 22 '24 02:05 joehiggi1758

This works now

phofl avatar Jan 13 '25 15:01 phofl