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

Python: Improve the discovery of the %view magic use in the Console to view Data Frames #5840

Open
petetronic opened this issue Dec 20, 2024 · 2 comments
Labels
area: console Issues related to Console category. enhancement New feature or request lang: python

Comments

@petetronic
Copy link
Collaborator

petetronic commented Dec 20, 2024

Describe the issue:

Positron extended the % magics from ipython, including a %view magic syntax that allows the user to launch a "Data Explorer" view for a Data Frame variable from a Python Console. This is similar to the R Console's View() function.

New users to the product would benefit to know this helpful syntax exists, but it needs to be more discoverable beyond % completions (and the % completion text itself needs improvement).

In the beta documentation, this capabilities is briefly mentioned, but it would not be obvious for a new user to find this today:
https://positron.posit.co/data-explorer.html#open-a-dataframe-in-the-data-explorer

To open a new instance of the Data Explorer on a specific data frame, use one of the following methods:

Use the language runtime directly:
- Via Python: %view dataframe label

Ideas:

  • The first time a DataFrame variable is created in a statement executed in a Python Console session, the kernel could return an output with a comment advertising the %view capability. This comment could have some minimal formatting to make it clear it is instructional rather than a computation.

  • If this capability were broadly useful enough, the Python Kernel banner could mention it. Or, at least, it should mention the syntax of magics and also have better documentation about the magics.

  • If the Console had AI assistant capabilities, based on the data types in statements being executed, it could also suggest this magic.

  • "Data" types in the Variables pane already have a "Table" icon that launches a data frame in a Data Explorer. Tooltips could be added to these variables to help users discover the Console magic alternative to clicking on these in the Variables pane.

  • When a "Home" page exists in Help, it could mention this magic as a tip for Python.

  • When RStudio's view data frame icon is clicked in its Environment pane, it emits a View() call to the R Console. Is this something Positron would want to do to make the connection between the Console functionality and the UI?

Dismissed:

  • While the kernel could return a message to the UI on first usage, a "toast" notification could be annoying, and would require added complexity to support "Never" show this again. Unless someone where in a "tour" mode, this method would likely be annoying.
@petetronic petetronic added area: console Issues related to Console category. enhancement New feature or request lang: python labels Dec 20, 2024
@jthomasmock
Copy link
Contributor

Something we toyed with as part of console improvements was to have a "View data" button for printed dataframes in the console, as well as in Notebooks. This somewhat overlaps with #3825, but I think this current issue has more detail, so we could close the other as dupe.

Copying over two comments from 3825.

Tom: It would be nice to also have a breadcrumb or indicator in the console when printing dataframes as a indicator they can open the data in the Data Explorer.

Julia: I just got feedback that the grid icon does not look clickable at all.

@jthomasmock jthomasmock marked this as a duplicate of #3825 Dec 20, 2024
@petetronic
Copy link
Collaborator Author

Something we toyed with as part of console improvements was to have a "View data" button for printed dataframes in the console, as well as in Notebooks. This somewhat overlaps with #3825, but I think this current issue has more detail, so we could close the other as dupe.

Thanks for noticing that and apologies for the duplicate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: console Issues related to Console category. enhancement New feature or request lang: python
Projects
None yet
Development

No branches or pull requests

2 participants