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

Unreachable code when using read_excel function in polars module #575

Closed
arnabanimesh opened this issue Oct 11, 2024 · 1 comment
Closed
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.

Comments

@arnabanimesh
Copy link

arnabanimesh commented Oct 11, 2024

Diagnostic Data

  • Python version (& distribution if applicable, e.g., Anaconda): v3.12.5 (rye 0.39.0 managed)
  • Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): venv (rye managed)
  • Operating system (and version): Win 11 23H2 (22631.4169(
  • Version of tool extension you are using: v2024.0.0

Behaviour

Type the following code:

import polars as pl

df = pl.read_excel("data.xlsx")
print(df.columns)

Expected Behavior

No error

Actual Behavior

Showing Unreachable code warning in Line 4

Reproduction Steps:

Explained in the behavior section

Logs:

Click here for detailed logs 2024-10-11 07:10:15.599 [info] Name: Pylint 2024-10-11 07:10:15.599 [info] Module: pylint 2024-10-11 07:10:15.599 [debug] Configuration: {"name":"Pylint","module":"pylint"} 2024-10-11 07:10:15.599 [info] Python extension loading 2024-10-11 07:10:15.599 [info] Waiting for interpreter from Python extension. 2024-10-11 07:10:15.599 [info] No interpreter found from setting pylint.interpreter 2024-10-11 07:10:15.599 [info] Getting interpreter from ms-python.python extension for workspace d:\check 2024-10-11 07:10:15.599 [info] Python extension loaded 2024-10-11 07:10:15.599 [info] Interpreter from ms-python.python extension for d:\check: c:\Users\Arnab\.rye\shims\python.exe 2024-10-11 07:10:15.599 [info] No interpreter found from setting pylint.interpreter 2024-10-11 07:10:15.599 [info] Getting interpreter from ms-python.python extension for workspace d:\check 2024-10-11 07:10:15.599 [info] Interpreter from ms-python.python extension for d:\check: c:\Users\Arnab\.rye\shims\python.exe 2024-10-11 07:10:15.599 [info] Server run command: c:\Users\Arnab\.rye\shims\python.exe c:\Users\Arnab\.vscode\extensions\ms-python.pylint-2024.0.0\bundled\tool\lsp_server.py 2024-10-11 07:10:15.599 [info] Server: Start requested. 2024-10-11 07:10:15.599 [debug] Server State: Starting 2024-10-11 07:10:15.744 [info] CWD Server: d:\check 2024-10-11 07:10:15.920 [info] Settings used to run Server: [ { "enabled": true, "cwd": "d:\\check", "workspace": "file:///d%3A/check", "args": [], "severity": { "convention": "Information", "error": "Error", "fatal": "Error", "refactor": "Hint", "warning": "Warning", "info": "Information" }, "path": [], "ignorePatterns": [], "interpreter": [ "c:\\Users\\Arnab\\.rye\\shims\\python.exe" ], "importStrategy": "useBundled", "showNotifications": "off", "extraPaths": [] } ]

2024-10-11 07:10:15.981 [info] Global settings:
{
"cwd": "${workspaceFolder}",
"enabled": true,
"workspace": "C:\Users\Arnab\AppData\Local\Programs\Microsoft VS Code",
"args": [],
"severity": {
"convention": "Information",
"error": "Error",
"fatal": "Error",
"refactor": "Hint",
"warning": "Warning",
"info": "Information"
},
"path": [],
"ignorePatterns": [],
"interpreter": [],
"importStrategy": "useBundled",
"showNotifications": "off",
"extraPaths": []
}

2024-10-11 07:10:15.984 [info] sys.path used to run Server:
d:\check
c:\Users\Arnab.vscode\extensions\ms-python.pylint-2024.0.0\bundled\libs
c:\Users\Arnab.vscode\extensions\ms-python.pylint-2024.0.0\bundled\tool
C:\Users\Arnab.rye\py\[email protected]\python312.zip
C:\Users\Arnab.rye\py\[email protected]\DLLs
C:\Users\Arnab.rye\py\[email protected]\Lib
C:\Users\Arnab.rye\py\[email protected]
d:\check.venv
d:\check.venv\Lib\site-packages
2024-10-11 07:10:16.009 [info] c:\Users\Arnab.rye\shims\python.exe -m pylint --version
2024-10-11 07:10:16.226 [info] CWD Linter: d:\check
2024-10-11 07:10:18.143 [info]
pylint 3.2.7
astroid 3.2.4
Python 3.12.5 (main, Aug 14 2024, 04:23:18) [MSC v.1929 64 bit (AMD64)]

2024-10-11 07:10:18.169 [info] Version info for linter running for D:\check:
pylint 3.2.7
astroid 3.2.4
Python 3.12.5 (main, Aug 14 2024, 04:23:18) [MSC v.1929 64 bit (AMD64)]

2024-10-11 07:10:18.218 [info] SUPPORTED pylint>=2.12.2
FOUND pylint==3.2.7

2024-10-11 07:10:18.222 [debug] Server State: Running
2024-10-11 07:10:18.631 [info] c:\Users\Arnab.vscode\extensions\ms-python.pylint-2024.0.0\bundled\tool\lsp_server.py:103: DeprecationWarning: 'workspace.get_document' has been deprecated, use 'workspace.get_text_document' instead
document = LSP_SERVER.workspace.get_document(params.text_document.uri)

2024-10-11 07:10:18.637 [info] [Trace - 7:10:18 AM] Received notification 'window/logMessage'.
2024-10-11 07:10:18.637 [info] Params: {
"type": 4,
"message": "c:\Users\Arnab\.rye\shims\python.exe -m pylint --reports=n --output-format=json --clear-cache-post-run=y --from-stdin d:\check\hi.py"
}

2024-10-11 07:10:18.637 [info] c:\Users\Arnab.rye\shims\python.exe -m pylint --reports=n --output-format=json --clear-cache-post-run=y --from-stdin d:\check\hi.py
2024-10-11 07:10:18.638 [info] [Trace - 7:10:18 AM] Received notification 'window/logMessage'.
2024-10-11 07:10:18.638 [info] Params: {
"type": 4,
"message": "CWD Linter: d:\check"
}

2024-10-11 07:10:18.638 [info] CWD Linter: d:\check
2024-10-11 07:10:21.777 [info] [Trace - 7:10:21 AM] Received notification 'window/logMessage'.
2024-10-11 07:10:21.777 [info] Params: {
"type": 4,
"message": "file:///d%3A/check/hi.py :\r\n[\n {\n "type": "convention",\n "module": "hi",\n "obj": "",\n "line": 1,\n "column": 0,\n "endLine": null,\n "endColumn": null,\n "path": "hi.py",\n "symbol": "missing-module-docstring",\n "message": "Missing module docstring",\n "message-id": "C0114"\n },\n {\n "type": "warning",\n "module": "hi",\n "obj": "",\n "line": 4,\n "column": 0,\n "endLine": 4,\n "endColumn": 17,\n "path": "hi.py",\n "symbol": "unreachable",\n "message": "Unreachable code",\n "message-id": "W0101"\n }\n]\n"
}

2024-10-11 07:10:21.777 [info] file:///d%3A/check/hi.py :
[
{
"type": "convention",
"module": "hi",
"obj": "",
"line": 1,
"column": 0,
"endLine": null,
"endColumn": null,
"path": "hi.py",
"symbol": "missing-module-docstring",
"message": "Missing module docstring",
"message-id": "C0114"
},
{
"type": "warning",
"module": "hi",
"obj": "",
"line": 4,
"column": 0,
"endLine": 4,
"endColumn": 17,
"path": "hi.py",
"symbol": "unreachable",
"message": "Unreachable code",
"message-id": "W0101"
}
]

2024-10-11 07:10:21.777 [info] [Trace - 7:10:21 AM] Received notification 'textDocument/publishDiagnostics'.
2024-10-11 07:10:21.777 [info] Params: {
"uri": "file:///d%3A/check/hi.py",
"diagnostics": [
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"message": "Missing module docstring",
"severity": 3,
"code": "C0114:missing-module-docstring",
"codeDescription": {
"href": "https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/missing-module-docstring.html"
},
"source": "Pylint"
},
{
"range": {
"start": {
"line": 3,
"character": 0
},
"end": {
"line": 3,
"character": 17
}
},
"message": "Unreachable code",
"severity": 2,
"code": "W0101:unreachable",
"codeDescription": {
"href": "https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/unreachable.html"
},
"source": "Pylint"
}
]
}

Outcome When Attempting Debugging Steps:

Did running it from the command line work? NA

Extra Details

NA

@arnabanimesh arnabanimesh added the bug Issue identified by VS Code Team member as probable bug label Oct 11, 2024
@github-actions github-actions bot added the triage-needed Issue is not triaged. label Oct 11, 2024
@arnabanimesh
Copy link
Author

arnabanimesh commented Oct 11, 2024

Reported the issue in pylint repo as it is a bug related to pylint and not the extension itself: pylint-dev/pylint#10016

@arnabanimesh arnabanimesh closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

1 participant