-
Notifications
You must be signed in to change notification settings - Fork 27
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
lib/scylla_cloud: use functool.cache to cache identify_cloud_async() #514
Conversation
@tchaikov It seems that this change is breaking tests. please check it as well https://github.com/scylladb/scylla-machine-image/actions/runs/8447372797/job/23137618753?pr=514 |
it does. so we are testing w/ python |
@fruch hi Israel, do we need to support python 3.8? on RHEL8 python 3.6 is the default. so we are not likely to be stuck with RHEL8. in RHEL9, Python 3.9 is the default. Fedora 38, 3.11. ubuntu 22.04 3.10. but yeah, ubuntu 20.04, 3.8. so are we trying to be compatible with ubuntu 20.04? |
None of the above, we are using our own python version from scylla-python3, and currently on master it's 3.11 (if I remember correctly) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@fruch thanks for confirmation. lemme bump the github workflow to use Python 3.11 then. that should match with the version we use in production. |
This comment was marked as resolved.
This comment was marked as resolved.
this change is a follow-up of d97e311, which caches the result of `identify_cloud_async()` using a global variable. it would be more idiomatic to use `functool.cache` for caching a costy function like `identify_cloud_async()`, so in this change we use it for caching. simpler this way. and more importantly, it is more readable. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
45ab069
to
22f9c36
Compare
@fruch good to merge? |
I think yes but leave it to @yaronkaikov to take it further (and if needed backport or not) |
ack. it's more of a cleanup. so IMHO, no need to backport. |
this change is a follow-up of d97e311, which caches the result of
identify_cloud_async()
using a global variable. it would be more idiomatic to usefunctool.cache
for caching a costy function likeidentify_cloud_async()
, so in this change we use it for caching. simpler this way. and more importantly, it is more readable.