henry3260 commented on code in PR #60258:
URL: https://github.com/apache/airflow/pull/60258#discussion_r2672302487
##########
shared/logging/tests/logging/test_percent_formatter.py:
##########
@@ -29,3 +29,21 @@ def test_no_callsite(self):
formatted = fmter(mock.Mock(name="Logger"), "info", {"event": "our
msg"})
assert formatted == "(unknown file):0 our msg"
+
+ def test_percent_formatter_handles_none_values(self):
+ """Test that PercentFormatRender handles None values gracefully."""
+ fmter = PercentFormatRender("%(filename)s:%(lineno)d %(message)s")
+
+ # Mock logger and event_dict with None values
+ logger = mock.Mock(name="Logger")
+ event_dict = {
+ "event": "test message",
+ "filename": None,
+ "lineno": None,
+ }
Review Comment:
> I'm not sure it is -- since we had `self.event.get(key)` -- that would
have returned None. So from the error alone we can't tell what the dict looked
like
Yeah, that makes sense. Sorry, I missed that point about .get().
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]