posit-dev / posit-dev/py-shiny

DataGrid not showing using ui.output_data_frame

Open
#764 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.8k
Forks
135
Avg merge
2d 18h
Merged PRs (30d)
21

Description

I'm using DataGrid and render.data_frame to be able to do row selection but the data frame is not displaying. When debugging, the returned object is a DataGrid shiny object. If I'm using basic pd.DataFrame everything is right.

Here, the server part :

@output
@render.data_frame
def feature_selection():
  meth = input.meth_graph()
  results = tranformed_data().dict_results[meth][2]
  to_return =  pd.DataFrame([raw_data().features,results]).T
  return render.DataGrid(
    to_return,
    row_selection_mode = 'multiple')

Here the ui part :

ui.nav(
  ui.row(
    ui.output_data_frame('feature_selection')
  )
)

Contributor guide

No contributing guide indexed for this repository

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 reproducing the provided server and UI code with render.DataGrid and ui.output_data_frame, then inspect the data-frame rendering path and its handling of DataGrid objects. Done means the returned DataGrid is displayed and multiple row selection works as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.