Skip to content

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

Merged
merged 3 commits into from
Aug 14, 2025

Conversation

rads-1996
Copy link
Member

@rads-1996 rads-1996 commented Aug 13, 2025

Description

Added typing to the put method of LocalFileBlob and LocalFileStorage. Updated LocalFileBlob.put to return a success status when the file path is successfully constructed, instead of returning self, as this value was not being utilized anywhere.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Copilot Copilot AI review requested due to automatic review settings August 13, 2025 18:09
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Aug 13, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 and LocalFileStorage.put methods
  • Updated LocalFileBlob.put to return StorageExportResult.LOCAL_FILE_BLOB_SUCCESS instead of self
  • 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.

@rads-1996 rads-1996 merged commit 47338a5 into Azure:main Aug 14, 2025
19 checks passed
@rads-1996 rads-1996 deleted the refactor-storage-put-methods branch August 14, 2025 16:48
@rads-1996 rads-1996 restored the refactor-storage-put-methods branch August 15, 2025 14:59
@rads-1996 rads-1996 deleted the refactor-storage-put-methods branch August 15, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monitor - Exporter Monitor OpenTelemetry Exporter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants