Skip to content
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

chore: Remove unreachable return statements #17622

Merged
merged 2 commits into from
Dec 7, 2021
Merged

chore: Remove unreachable return statements #17622

merged 2 commits into from
Dec 7, 2021

Conversation

PApostol
Copy link
Contributor

@PApostol PApostol commented Dec 1, 2021

Remove unreachable return statements in superset/utils/network.py.

SUMMARY

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

@PApostol PApostol changed the title chroe: Remove unreachable return statements chore: Remove unreachable return statements Dec 1, 2021
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #17622 (8a00245) into master (0544bee) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #17622   +/-   ##
=======================================
  Coverage   68.55%   68.55%           
=======================================
  Files        1601     1601           
  Lines       65271    65270    -1     
  Branches     6966     6966           
=======================================
+ Hits        44745    44746    +1     
+ Misses      18636    18634    -2     
  Partials     1890     1890           
Flag Coverage Δ
hive 81.39% <0.00%> (+<0.01%) ⬆️
mysql 81.80% <0.00%> (+<0.01%) ⬆️
postgres 81.81% <0.00%> (+<0.01%) ⬆️
presto 81.69% <0.00%> (+<0.01%) ⬆️
python 82.31% <0.00%> (+<0.01%) ⬆️
sqlite 81.50% <0.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/utils/network.py 37.93% <0.00%> (+2.44%) ⬆️
superset/db_engine_specs/presto.py 90.39% <0.00%> (ø)
superset/charts/schemas.py 99.33% <0.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0544bee...8a00245. Read the comment docs.

@@ -38,8 +38,6 @@ def is_port_open(host: str, port: int) -> bool:
finally:
s.close()

return False
Copy link
Member

Choose a reason for hiding this comment

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

bycatch: I notice that port is an int in the argument list, but we're recasting it to int on line 33, which is unnecessary. While we're at it, I'd almost recommend removing that cast, and make sure code ever calls this function with anything except an int value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot; I have taken out the int cast - by the looks of it, is_port_open() is only used here, where port is indeed an integer.

@villebro villebro merged commit 9121e45 into apache:master Dec 7, 2021
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants