question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLN remove unreachable code in pandas/core/groupby/generic.py::DataFrameGroupBy::_wrap_applied_output

See original GitHub issue

NOTE: 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:

  1. 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)
  2. Remove this unused else branch

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
MarcoGorellicommented, Oct 4, 2020

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!

1reaction
alimcmaster1commented, Apr 12, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found