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

code incorrectly marked as unreachable #5685

Closed
bryjohnston opened this issue Mar 25, 2024 · 2 comments
Closed

code incorrectly marked as unreachable #5685

bryjohnston opened this issue Mar 25, 2024 · 2 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@bryjohnston
Copy link

bryjohnston commented Mar 25, 2024

python 3.11.4
pylance v2024.3.1
pandas 2.2.1
vscode 1.87.2 windows 10

Since the latest pylance update, I have found large portions of code being marked as unreachable when they definitely are not.
I don't know for sure that this is a pandas issue, but that was the easiest way I could reproduce the error. In the following code (meaningless, just to demonstrate), the print statement is marked as unreachable by pylance following a use of the pandas function:

import pandas as pd

df1 = pd.DataFrame()
df2 = pd.DataFrame()


def testfxn(df1, df2):
    for a in range(5):
        test = pd.concat([df1, df2], axis=1)
        print('hi!')

testfxn(df1, df2)
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Mar 25, 2024
@debonte
Copy link
Contributor

debonte commented Mar 25, 2024

This is a duplicate of #5630. The underlying issue was in pandas-stubs. They have fixed it and their fix shipped in our 2024.3.101 prerelease build.

Our wiki has instructions on how to switch to prerelease if you need them: https://github.com/microsoft/pylance-release/wiki/FAQ#how-to-switch-pylance-builds

@debonte debonte closed this as completed Mar 25, 2024
@debonte debonte added duplicate This issue or pull request already exists and removed needs repro Issue has not been reproduced yet labels Mar 25, 2024
@debonte
Copy link
Contributor

debonte commented Mar 25, 2024

This issue is also fixed in our most recent stable release -- 2024.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants