Skip to content

chore: Remove the need for explicit bubble up of certain exceptions#29235

Merged
john-bodley merged 1 commit intoapache:masterfrom
john-bodley:john-bodley--fix-remove-bubble-up
Jun 13, 2024
Merged

chore: Remove the need for explicit bubble up of certain exceptions#29235
john-bodley merged 1 commit intoapache:masterfrom
john-bodley:john-bodley--fix-remove-bubble-up

Conversation

@john-bodley
Copy link
Member

@john-bodley john-bodley commented Jun 12, 2024

SUMMARY

There are instances where we bubble up exceptions, however this is akin to simply not catching it, since any uncaught exception is propagated up the call stack.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@github-actions github-actions bot added the api Related to the REST API label Jun 12, 2024
@john-bodley john-bodley changed the title chore: Remove the need for explicit bubble up chore: Remove the need for explicit bubble up of certain exceptions Jun 12, 2024
@codecov
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.72%. Comparing base (76d897e) to head (be05ada).
Report is 1094 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29235       +/-   ##
===========================================
+ Coverage   60.48%   83.72%   +23.23%     
===========================================
  Files        1931      518     -1413     
  Lines       76236    37513    -38723     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31408    -14706     
+ Misses      28017     6105    -21912     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.95% <0.00%> (-0.22%) ⬇️
javascript ?
mysql 77.20% <100.00%> (?)
postgres 77.33% <100.00%> (?)
presto 53.57% <0.00%> (-0.24%) ⬇️
python 83.72% <100.00%> (+20.23%) ⬆️
sqlite 76.79% <0.00%> (?)
unit 59.21% <100.00%> (+1.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@john-bodley john-bodley marked this pull request as ready for review June 12, 2024 23:28
@mistercrunch
Copy link
Member

Right. I considered doing the same during #29166, but thought there might have some reason for the code to point out the "likely exception" in the code, maybe to allow future handling or something. I decided to leave them as they were since my goal was enabling the lint rule and minimizing the code changes.

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

Approving as those lines effectively do nothing - except maybe for calling out semantically in the code the exceptions that are likely to happen during the try block.

@john-bodley
Copy link
Member Author

@mistercrunch the catalyst for the change is I was rebasing #24969 (a longstanding PR I've been wrangling with failing tests for a while).

@michael-s-molina
Copy link
Member

michael-s-molina commented Jun 13, 2024

thought there might have some reason for the code to point out the "likely exception" in the code, maybe to allow future handling or something.

@mistercrunch I think for this case, the best approach is to document the exceptions in docstrings:

"""
    Perform some operation.

    Raises:
        ValueError: If the input is invalid.
        FileNotFoundError: If a required file is not found.
        CustomException: If a specific condition is not met.
"""

@john-bodley john-bodley force-pushed the john-bodley--fix-remove-bubble-up branch from 2c1f467 to be05ada Compare June 13, 2024 15:54
@pull-request-size pull-request-size bot added size/M and removed size/S labels Jun 13, 2024
@john-bodley
Copy link
Member Author

@michael-s-molina I addressed your comment.

@john-bodley john-bodley merged commit daf37cb into apache:master Jun 13, 2024
@john-bodley john-bodley deleted the john-bodley--fix-remove-bubble-up branch June 13, 2024 16:41
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 First shipped in 4.1.0 labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 4.1.0 First shipped in 4.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants