-
Notifications
You must be signed in to change notification settings - Fork 300
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
Data viewer is not recognizing objects of pandas.DataFrame
subclass
#9264
Comments
We can fix this, instead of checking whether the type is dataframe we need to check if the type inherits dataframe. |
@DonJayamanne Thanks! Should we submit an issue with the Python extension? I am not sure how it is supposed to work. |
This is an issue in this extension, hence the issue belongs here. |
The issue still appears in the latest version of VSCode 1.75.1 |
Closing this issue as fixed, I just tested this and it works from pandas import DataFrame
class MyDF(DataFrame):
...
pd_df = DataFrame(dict(a=[1,2,3,4], b=[5,6,7,8]))
pd_df1 = MyDF(dict(a=[1,2,3,4], b=[5,6,7,8])) |
With the same code example @pw provided, I still don't see MyDF treated the same as a pandas DataFrame, there is an icon next to the name (highlighted in red) and Size appear to be different when inspecting Variables. from pandas import DataFrame
class MyDF(DataFrame):
...
pd_df = DataFrame(dict(a=[1,2,3]))
my_df = MyDF(dict(a=[1,2,3])) |
I can still replicate this issue. |
Applies To
What happened?
A standard pandas data frame, which is an instance of
pandas.DataFrame
, is able to be expanded in the data viewer. However, an instance ofpandas.DataFrame
subclass is not.VS Code Version
1.64.2
Jupyter Extension Version
v2022.1.1301854968
Jupyter logs
No response
Coding Language and Runtime Version
Python 3.9.5 (pandas 1.4.1)
Language Extension Version (if applicable)
Python v2022.2.1924087327
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Remote
The text was updated successfully, but these errors were encountered: