-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Refactored storage.py put methods #42502
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
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.
Pull Request Overview
This PR refactors the put
methods in the storage.py module by adding proper typing annotations and updating the return behavior. The LocalFileBlob.put
method now returns StorageExportResult.LOCAL_FILE_BLOB_SUCCESS
instead of self
to improve clarity since the self-reference was not being used anywhere in the codebase.
Key changes:
- Added type annotations to
LocalFileBlob.put
andLocalFileStorage.put
methods - Updated
LocalFileBlob.put
to returnStorageExportResult.LOCAL_FILE_BLOB_SUCCESS
instead ofself
- Updated corresponding test files to reflect the new return behavior
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
azure/monitor/opentelemetry/exporter/_storage.py |
Added typing imports and return type annotations, updated LocalFileBlob.put to return StorageExportResult.LOCAL_FILE_BLOB_SUCCESS |
azure/monitor/opentelemetry/exporter/export/_base.py |
Updated comment to reflect new LocalFileBlob.put return behavior |
tests/test_storage.py |
Updated all test assertions to expect StorageExportResult instead of LocalFileBlob instances |
tests/test_base_exporter.py |
Added new tests to verify proper handling of the new StorageExportResult return values |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Description
Added typing to the put method of
LocalFileBlob
andLocalFileStorage
. UpdatedLocalFileBlob.put
to return a success status when the file path is successfully constructed, instead of returningself
, as this value was not being utilized anywhere.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines