-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix pylint issues in azure-eventhub-checkpointstoreblob #41228
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: l0lawrence <[email protected]>
I'm not sure do-not-log-raised-errors is resolved |
Co-authored-by: l0lawrence <[email protected]>
Good catch! I've fixed the issue by removing the logging statement before re-raising the exception in the Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@@ -252,16 +252,8 @@ def list_ownership( | |||
} | |||
result.append(ownership) | |||
return result | |||
except Exception as error: | |||
logger.warning( |
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.
would it be better to make this a debug log rather than removing it altogether?
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.
Good suggestion! I've restored the debug logging for exceptions in the list_ownership method while still maintaining compliance with the C4762 rule (do-not-log-raised-errors) by using the debug level. You can see this change in commit e516b70.
Co-authored-by: swathipil <[email protected]>
This PR addresses pylint warnings in the
azure-eventhub-checkpointstoreblob
library when running with pylint 3.3.6. The changes focus on proper exception logging practices according to the Azure SDK guidelines.The following issues were fixed:
C4766 (do-not-log-exceptions-if-not-debug) - Changed log level from
warning
todebug
in two locations:_claim_one_partition
method to ensure exceptions are only logged at debug levellist_ownership
method to prevent potentially sensitive information from being logged at higher levelsC4762 (do-not-log-raised-errors) - Fixed in
list_ownership
method:warning
todebug
These changes reduce the chance of exposing sensitive information in logs and follow the best practices as described in the Python logging sensitive information documentation.
Fixes #40744.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.