posit-dev / posit-dev/positron

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

Open
#5,840 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area: console enhancement lang: python
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 11h
Merged PRs (30d)
206

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked Data Explorer documentation and the named Python Console, %view magic, Variables pane, kernel banner, and Help entry points. The issue offers several competing approaches, so agree on one discoverability path and acceptance criteria before locating implementation and tests; done means users can find and understand %view without relying only on completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.