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

Errors highlighted when using pipetools module #1886

Closed
leldershaw opened this issue Sep 29, 2021 · 2 comments
Closed

Errors highlighted when using pipetools module #1886

leldershaw opened this issue Sep 29, 2021 · 2 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@leldershaw
Copy link

Environment data

  • Language Server version: 2021.9.3
  • OS and version: darwin x64
  • Python version (and distribution if applicable, e.g. Anaconda): 3.9.2
  • python.analysis.indexing: undefined
  • python.analysis.typeCheckingMode: off

Expected behaviour

Use of the symbol | to pipe tasks together using the pipe function in the pipetools package causing no highlighted Pylance errors.

Actual behaviour

Pylance is highlighting an an error with the use of | symbol before a list call when piping tasks together using pipetools. It states that Alternative syntax for unions requires Python 3.10 or newer. The code runs with no issues in Python 3.9.2 as pipetools is imported. This error goes away if Python 3.10 is used, but should not occur for v3.9.2.

Logs

Python Language Server Log

No log output to provide

Code Snippet / Additional information

pip install pipetools
from pipetools import pipe, where

odd_sum = (pipe | 
            range | 
            where(lambda x: x % 2) |    #This pipe symbol shows an error as it is before a `list` call
            list |
            sum)

print(odd_sum (5))
@erictraut
Copy link
Contributor

Thanks for the bug report. I agree this is a false positive error. It will be fixed in the next release.

@jakebailey jakebailey added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version labels Sep 29, 2021
@github-actions github-actions bot removed the triage label Sep 29, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.9.4, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202194-29-september-2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants