Skip to content

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

Merged
xrmx merged 7 commits intoopen-telemetry:mainfrom
srikaaviya:fix/falcon-handle-exception-pylint-4198
Mar 2, 2026
Merged

Fix falcon-instrumentation _handle_exception method to remove pylint disables#4207
xrmx merged 7 commits intoopen-telemetry:mainfrom
srikaaviya:fix/falcon-handle-exception-pylint-4198

Conversation

@srikaaviya
Copy link
Contributor

@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.

  • ✅ login: xrmx / name: Riccardo Magliocchetti (b5f16ae)

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
@emdneto emdneto moved this to Easy to review / merge / close in Python PR digest Feb 25, 2026
@tammy-baylis-swi tammy-baylis-swi moved this from Easy to review / merge / close to Approved PRs in Python PR digest Feb 26, 2026
@xrmx xrmx enabled auto-merge (squash) February 27, 2026 09:54
@xrmx xrmx merged commit 821e332 into open-telemetry:main Mar 2, 2026
771 checks passed
@github-project-automation github-project-automation bot moved this from Approved PRs to Done in Python PR digest Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Improve falcon-instrumentation _handle_exception method to remove pylint disables

4 participants