-
Notifications
You must be signed in to change notification settings - Fork 8
download_file_from_gcs now uses cache. #133
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
Conversation
e621eda to
b0a17e1
Compare
anth-volk
left a comment
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.
Per discussion with @mikesmit, due to lack of integration testing capabilities and the fact that the v2 service is not used by customers, we will merge and roll back on off chance that file downloads are misconfigured.
b0a17e1 to
3e01076
Compare
| @@ -1,3 +1,26 @@ | |||
| from .data.caching_google_storage_client import CachingGoogleStorageClient | |||
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.
issue, blocking: Add a changelog entry
Without it, this package won't launch to PyPI, and there's no check for changelog_entry.yaml in the GH Actions
| def _get_client(): | ||
| global _caching_client | ||
| if _caching_client is not None: | ||
| print("Caching client already created") |
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.
question: Is there an advantage to printing over using the logging package?
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.
oh that was me debugging. Will remove this and the other one.
| if _caching_client is not None: | ||
| print("Caching client already created") | ||
| return _caching_client | ||
| print("Creating caching client") |
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.
question: Here, too, would it be better to log?
anth-volk
left a comment
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.
A couple minor questions and one blocking issue: a changelog_entry.yaml file is needed to trigger PyPI deployment
Related to PolicyEngine/issues#350 this change re-implements the download_file_from_gcs function to use CachingGoogleStorageClient. Files should now be cached locally on a per-process basis and only updated on disk when the remote version crc changes.
3e01076 to
566a067
Compare
Revert "Merge pull request #133 from PolicyEngine/350_use_caching_goo…
Related to PolicyEngine/issues#350
this change re-implements the download_file_from_gcs function to use CachingGoogleStorageClient.
Files should now be cached locally on a per-process basis and only updated on disk when the remote version crc changes.