CLN remove unreachable code in pandas/core/groupby/generic.py::DataFrameGroupBy::_wrap_applied_output
See original GitHub issueNOTE: I’d originally opened a PR to address this, but am now busy with other obligations + other PRs to respond to. So I’m opening it up as a good first issue for now, and will return to work on it if nobody takes it.
In pandas/core/groupby/generic.py::DataFrameGroupBy::_wrap_applied_output
, it seems this branch is never reached:
else:
# Handle cases like BinGrouper
return self._concat_objects(keys, values, not_indexed_same=not_indexed_same)
Two things need to be done here:
- refactor
_wrap_applied_output
by making a helper function out of some of its internals (it’s currently very long, and changes are hard to review) - Remove this unused
else
branch
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (13 by maintainers)
Top Results From Across the Web
Warning: unreachable code after return statement - JavaScript
When an expression exists after a valid return statement, a warning is given to indicate that the code after the return statement is...
Read more >Remove unreachable code refactoring - Visual Studio ...
Press Ctrl+. to trigger the Quick Actions and Refactorings menu and select Remove unreachable code from the Preview window popup.
Read more >Is unreachable code safe to remove? (-Wunreachable-code)
Read the code, understand it, and if the code marked unreachable really is unreachable and it isn't unreachable because of a logic error, ......
Read more >Why am i getting unreachable code on the following code?
Getting 2 error messages, first one says type is defined but never user and the second message says unreachable code can someone help...
Read more >MSC07-C. Detect and remove dead code
CodeSonar. 7.2p0. DIAG.UNEX.* LANG.STRUCT.RC LANG.STRUCT.UC. Code not exercised by analysis. Redundant condition. Unreachable {Call, Computation, Conditional, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @fokoid , thanks for bringing my attention back to this - it looks like @rhshadrach has already done some excellent refactoring here, this function is now significantly simpler than it was when I opened this, so IMO we’re OK to close
Nonetheless, there are many open issues to work on, any help there would be welcome!
I think the first steps are to look at the _transform_general function and see how it could be broken down in more manageable/reusable functions. Might be quite a challenging good first issue - but feel free to give it a shot and let us know if you have any questions