-
Notifications
You must be signed in to change notification settings - Fork 624
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
Update ValueError message that is misleading #3769
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/export/__init__.py
Outdated
Show resolved
Hide resolved
That makes total sense! I’ll update the PR. Very nice suggestion :-)Sent from my iPhoneOn Mar 11, 2024, at 11:31 AM, Tammy Baylis ***@***.***> wrote:
@tammy-baylis-swi commented on this pull request.
In opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/export/__init__.py:
@@ -496,7 +496,7 @@ def __init__(
elif self._export_interval_millis <= 0:
raise ValueError(
f"interval value {self._export_interval_millis} is invalid \
- and needs to be larger than zero and lower than infinity."
+ and needs to be larger than zero and lower than or equal to infinity."
Thank you putting in this PR to match actual behaviour and the Reader class docstring.
I suggest we make the message simpler:
⬇️ Suggested change
- and needs to be larger than zero and lower than or equal to infinity."
+ and needs to be larger than zero."
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
tammy-baylis-swi
approved these changes
Mar 12, 2024
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.
Thank you!
xrmx
approved these changes
Mar 12, 2024
lzchen
approved these changes
Mar 14, 2024
Please fix the conflicts and we can get this merged! Thanks! |
Related issue: open-telemetry#3768 where error message does not include 'infinity' as one of the accepted range of values for interval.
added to changelog.md
fixed the sentence to be more concise.
ocelotl
approved these changes
Mar 14, 2024
auto-merge was automatically disabled
March 14, 2024 18:05
Pull Request is not mergeable
auto-merge was automatically disabled
March 14, 2024 19:40
Pull Request is not mergeable
I don't see any conflicts. What are you referring to? |
ocelotl
pushed a commit
to ocelotl/opentelemetry-python
that referenced
this pull request
Mar 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The ValueError message is misleading that it does not include infinity as accepted value as interval. The message therefore needs to be changed as developers were getting confused.
Fixes #3768
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
The behavior can be seen when you try to set the reporting interval with Zero. However, setting the value as math.inf does work.
Does This PR Require a Contrib Repo Change?
Answer the following question based on these examples of changes that would require a Contrib Repo Change:
The OTel specification has changed which prompted this PR to update the method interfaces of
opentelemetry-api/
oropentelemetry-sdk/
The method interfaces of
test/util
have changedScripts in
scripts/
that were copied over to the Contrib repo have changedConfiguration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in
pyproject.toml
isort.cfg
.flake8
When a new
.github/CODEOWNER
is addedMajor changes to project information, such as in:
README.md
CONTRIBUTING.md
Yes. - Link to PR:
No.
Checklist: