[pull] main from apache:main#171
Merged
Merged
Conversation
In burr/core/graph.py, the function _render_graphviz() used 'format' as a local variable name, which shadows Python's built-in format() function. Renamed it to 'fmt' to avoid the shadowing while preserving all existing behavior. The variable is used only within the function scope and the rename is consistent and self-documenting.
…tional inputs exist
In burr/core/action.py, the validate_inputs() method had a bug in its
error message construction due to operator precedence in a nested ternary
expression.
The original code:
raise ValueError(
f"Inputs to function {self} are invalid. "
+ f"Missing the following inputs: ..."
if missing_inputs
else (...)
)
Due to Python operator precedence, the ternary 'if' binds lower than '+',
so the whole expression is evaluated as:
(str1 + str2) if missing_inputs else (str3 if additional_inputs else "")
This means when BOTH missing_inputs and additional_inputs are non-empty,
the error message only reports the missing inputs and silently drops info
about the additional inputs. Similarly, when only additional_inputs exist,
the 'Inputs to function ... are invalid' prefix is omitted.
Fixed by building error message parts independently:
- Always include the 'Inputs to function ... are invalid' prefix
- Conditionally append missing inputs info
- Conditionally append additional inputs info
- Join all parts with spaces
This ensures all relevant validation errors are reported regardless of
which combination of issues exist.
All other persister modules in burr/integrations/persisters/ use logging.getLogger(__name__) to create a properly scoped logger. b_aiosqlite.py was using logging.getLogger() (no arguments), which returns the root logger. Using the root logger is bad practice because: - It causes log messages to bypass the module's namespace, making it harder to filter or configure logging for this specific module. - It can lead to unexpected log output appearing in the root logger's handlers even when the module's logging is intended to be suppressed. This one-line fix changes it to logging.getLogger(__name__) for consistency with all other persister implementations.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )