-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[CI] Fix: flake8 rule B109: Using the functools.lru_cache and functools.cache decorators on methods can lead to memory leaks #48186
Conversation
575af7c
to
9e01cba
Compare
@MortalHappiness PTAL |
Signed-off-by: win5923 <ken89@kimo.com>
I wonder if the Maybe the original author intended to use cc @rynewang |
@bveeramani can you take a look at this issue and see if we want to change this cache? |
@bveeramani Hi why is this PR merged? I thought you intended to use |
… functools.cache decorators on methods can lead to memory leaks (ray-project#48186)" This reverts commit dc52ba4. Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com>
The intention is that we'd only compute the values once per instance (i.e., for each value of |
@bveeramani In Python, it’s more common to use See https://docs.python.org/3/faq/programming.html#faq-cache-method-calls for details. |
…ls.cache decorators on methods can lead to memory leaks (ray-project#48186) While running the pre-commit hook of flake8, the following error occurs if Python version is 3.12. It's because the version of flake8 is too old. ![image](https://github.com/user-attachments/assets/bf56370f-04d7-4b9a-aea9-e1c578547ed4) version: - python: 3.12.7 - flake8: 7.1.1 - flake8-bugbear: 24.8.19 Signed-off-by: win5923 <ken89@kimo.com>
…48436) Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com>
…ls.cache decorators on methods can lead to memory leaks (ray-project#48186) While running the pre-commit hook of flake8, the following error occurs if Python version is 3.12. It's because the version of flake8 is too old. ![image](https://github.com/user-attachments/assets/bf56370f-04d7-4b9a-aea9-e1c578547ed4) version: - python: 3.12.7 - flake8: 7.1.1 - flake8-bugbear: 24.8.19 Signed-off-by: win5923 <ken89@kimo.com>
…` instead (ray-project#48436) Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com>
…ls.cache decorators on methods can lead to memory leaks (ray-project#48186) While running the pre-commit hook of flake8, the following error occurs if Python version is 3.12. It's because the version of flake8 is too old. ![image](https://github.com/user-attachments/assets/bf56370f-04d7-4b9a-aea9-e1c578547ed4) version: - python: 3.12.7 - flake8: 7.1.1 - flake8-bugbear: 24.8.19 Signed-off-by: win5923 <ken89@kimo.com> Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
…` instead (ray-project#48436) Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com> Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
Why are these changes needed?
While running the pre-commit hook of flake8, the following error occurs if Python version is 3.12. It's because the version of flake8 is too old.
version:
Related issue number
Closes #48066
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.