Skip to content

Conversation

@jitseniesen
Copy link
Member

This PR adds support for displaying Polars data frames in Spyder's variable explorer to the Spyder kernels. The type is shown as "Polars DataFrame" and the value as "Column names: xxx" (same as for Pandas data frames). When the user opens an editor, the Polars data frame is converted to a Pandas data frame and sent to Spyder.

This conversion fails if Pandas is not installed in the console environment. To handle this properly on the Spyder side, the last commit extends the error handling in remote calls to also send the name attribute (if it exists) of exceptions raised when handling remote calls. This attribute contains the name of the module whose import failed in ModuleNotFoundError.

This PR is used in Spyder PR spyder-ide/spyder#24558. See there for a video of how it all looks.

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor suggestions for you @jitseniesen.

@ccordoba12 ccordoba12 added the type:Enhancement New feature or request label Jul 14, 2025
@ccordoba12 ccordoba12 added this to the v3.1.0a3 milestone Jul 14, 2025
jitseniesen and others added 4 commits July 15, 2025 16:23
If a remote call leads to an exception with a `name` attribute
(e.g., a ModuleNotFoundError), then add this to the JSON in
the reply.
@jitseniesen
Copy link
Member Author

Just a few minor suggestions for you

I applied the suggestions and rebased, I think this is ready now.

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks @jitseniesen!

@ccordoba12 ccordoba12 merged commit 7987954 into spyder-ide:master Jul 15, 2025
12 checks passed
@jitseniesen jitseniesen deleted the polars branch July 16, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants