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
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _claim_one_partition(self, ownership, **kwargs):
)
raise OwnershipLostError() from exc
except Exception as error: # pylint:disable=broad-except
logger.warning(
logger.debug(
"An exception occurred when EventProcessor instance %r claim_ownership for "
"namespace %r eventhub %r consumer group %r partition %r. "
"The ownership is now lost. Exception "
Expand Down Expand Up @@ -253,7 +253,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.

# Using debug level to comply with rule C4762 (do-not-log-raised-errors)
logger.debug(
"An exception occurred during list_ownership for "
"namespace %r eventhub %r consumer group %r. "
"Exception is %r",
Expand Down