-
Notifications
You must be signed in to change notification settings - Fork 11
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
ValueProvider errors to have helpful error messages #321
Conversation
@@ -24,6 +24,9 @@ def many_values(self, _: ProviderContext) -> Iterable[Any]: | |||
def is_static(self) -> bool: | |||
return True | |||
|
|||
def __str__(self): |
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.
StaticProvider does not have any posibility of errors in single or many_values methods
@@ -30,6 +30,9 @@ def many_values(self, context: ProviderContext) -> Iterable[Any]: | |||
return [] | |||
return value if isinstance(value, list) else [value] | |||
|
|||
def __str__(self): |
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.
VariableValueProvider does not have any errors that would benefit from anything other than the stack trace, which we already print
It's always nice to see additional context in the errors. Looks good to me! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
=======================================
Coverage 97.74% 97.75%
=======================================
Files 142 142
Lines 4754 4802 +48
=======================================
+ Hits 4647 4694 +47
- Misses 107 108 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Currently errors in value provider of a pipeline do not contain sufficient information. Need to show value provider expression and document in the error log message.
Introducing
__str__
method allows for a more readable string representation of ValueProvidersTry and except blocks are added in
single_value
andmany_values
methodsupdated tests