Skip to content

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented May 20, 2025

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:

  1. C4766 (do-not-log-exceptions-if-not-debug) - Changed log level from warning to debug in two locations:

    • In _claim_one_partition method to ensure exceptions are only logged at debug level
    • In list_ownership method to prevent potentially sensitive information from being logged at higher levels
  2. C4762 (do-not-log-raised-errors) - Fixed in list_ownership method:

    • Changed log level for the re-raised exception from warning to debug

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.

@Copilot Copilot AI changed the title [WIP] azure-eventhub-checkpointstoreblob needs linting updates for pylint version 3.3.6 Fix pylint issues in azure-eventhub-checkpointstoreblob May 20, 2025
@Copilot Copilot AI requested a review from l0lawrence May 20, 2025 20:48
@l0lawrence
Copy link
Member

I'm not sure do-not-log-raised-errors is resolved

Copy link
Author

Copilot AI commented May 20, 2025

I'm not sure do-not-log-raised-errors is resolved

Good catch! I've fixed the issue by removing the logging statement before re-raising the exception in the list_ownership method, which properly addresses the C4762 (do-not-log-raised-errors) rule. Commit f831d8f includes this fix.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • azure.github.io
    • Triggering command: curl -s REDACTED (dns block)

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(
Copy link
Member

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?

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azure-eventhub-checkpointstoreblob needs linting updates for pylint version 3.3.6
3 participants