Skip to content

Comments

Fix falcon-instrumentation _handle_exception method to remove pylint disables#4207

Open
srikaaviya wants to merge 5 commits intoopen-telemetry:mainfrom
srikaaviya:fix/falcon-handle-exception-pylint-4198
Open

Fix falcon-instrumentation _handle_exception method to remove pylint disables#4207
srikaaviya wants to merge 5 commits intoopen-telemetry:mainfrom
srikaaviya:fix/falcon-handle-exception-pylint-4198

Conversation

@srikaaviya
Copy link

@srikaaviya srikaaviya commented Feb 15, 2026

Description

The _handle_exception method in the Falcon instrumentation had pylint warnings suppressed with inline disable comments (C0103, W0237, W1114) because a single method definition was trying to handle two different Falcon versions that have
different argument orders.

This change defines _handle_exception conditionally based on the detected Falcon version
at import time:

  • For Falcon 1: _handle_exception(self, ex, req, resp, params) - matching the Falcon 1 base class signature
  • For Falcon 2+: _handle_exception(self, req, resp, ex, params) - matching the Falcon 2+ base class signature

Since each version now uses the correct parameter names in the correct order, all three
pylint warnings are resolved without needing any disable comments.

Fixes #4198

Test:

  • Existing Falcon instrumentation tests pass (35/41 — 6 pre-existing failures unrelated to this change)
  • Pylint runs clean with no C0103, W0237, or W1114 warnings
  • Pre-commit checks (ruff lint + format) pass

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 15, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srikaaviya lint still failing

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a23c80c
Pushed my change here

@srikaaviya srikaaviya requested a review from a team as a code owner February 20, 2026 04:28
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

srikaaviya added a commit to srikaaviya/opentelemetry-python-contrib that referenced this pull request Feb 21, 2026
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.

Improve falcon-instrumentation _handle_exception method to remove pylint disables

3 participants