-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[data] autodoc mishandling type annotations #45129
Comments
This happens because we have a lambda function as a default argument. We shouldn't be using mutable default arguments anyway (this should be caught by |
Looked more into this; I found a bunch of instances with the following grep: grep -rzPo --include="*.py" "(?s)def\s+\w+\s*\([^)]*?=\s*lambda[^)]*?\)" ./ | tr '\0' '\n' Key points:
Here's what
|
This PR fixes instances where lambda functions are used as default arguments. Since default arguments are evaluated at function definition time, mutable objects can have unintuitive behavior; additionally, they prevent our documentation from rendering correctly. This PR is part of #45129, but has been split up to minimize codeowner impact. Signed-off-by: pdmurray <peynmurray@gmail.com>
This PR fixes instances where lambda functions are used as default arguments. Since default arguments are evaluated at function definition time, mutable objects can have unintuitive behavior; additionally, they prevent our documentation from rendering correctly. This PR is part of #45129, but has been split up to minimize codeowner impact. Signed-off-by: pdmurray <peynmurray@gmail.com>
## Why are these changes needed? This PR fixes instances where lambda functions are used as default arguments. Since default arguments are evaluated at function definition time, mutable objects can have unintuitive behavior; additionally, they prevent our documentation from rendering correctly. This PR is part of #45129, but has been split up to minimize codeowner impact. ## Related issue number Partially addresses #45129. ## Checks - [x] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [x] I've run `scripts/format.sh` to lint the changes in this PR. - [x] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [x] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [x] Unit tests - [ ] Release tests - [ ] This PR is not tested :( Signed-off-by: pdmurray <peynmurray@gmail.com>
All PRs merged; closing. |
Description
The doc string for write_parquet doesn't seem to be rendering as intended. For example, the ~ray.data.datasource.filename_provider.FilenameProvider:
https://docs.ray.io/en/releases-2.9.0/data/api/doc/ray.data.Dataset.write_parquet.html
The source file is here: src/ray/python/ray/data/dataset.py
Broken since version 2.9.0 up until 2.20.0.
Link
https://docs.ray.io/en/releases-2.9.0/data/api/doc/ray.data.Dataset.write_parquet.html
The text was updated successfully, but these errors were encountered: