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

pandas stubs - cast Series as float (reportGeneralTypeIssues error) #148

Closed
tekumara opened this issue Jul 21, 2020 · 2 comments
Closed
Assignees
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@tekumara
Copy link

Environment data

  • Language Server version: v2020.7.2
  • OS and version: macOS
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.10

Expected behaviour

No type error. At runtime this works, so I would have thought it possible to cast a Series as a float?

Actual behaviour

Argument of type "Series[Unknown]" cannot be assigned to parameter "x" of type "SupportsFloat | _SupportsIndex | str | bytes | bytearray" in function "__init__"
  "__float__" is not present
  "__index__" is not present
  "Series[Unknown]" is incompatible with "str"
  "Series[Unknown]" is incompatible with "bytes"
  "Series[Unknown]" is incompatible with "bytearray"

Code Snippet / Additional information

import pandas as pd

s = pd.Series(1.0)
f = float(s)
@gramster
Copy link
Member

gramster commented Aug 6, 2020

Should be fixed in 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 and removed needs stub labels Aug 10, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.8.1, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202081-13-august-2020

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

4 participants