-
Notifications
You must be signed in to change notification settings - Fork 892
Description
Describe the bug
I have a df with more than 50 columns
I show it with mo.ui.table
I filter manual on one column
I select one row
I want to use the selected record with table.value in the next marimo cell.
BUG: The table.value is wrong. It has the data from a different row: Bob instead of Charlie (see screenshot above)
Workaround: Truncate the df to 50 or less columns and the selection works. 😀
Quick fix: There is already a warning "Result clipped. Showing 50 of 51 columns." Extend this warning with the message that selction on filtered tables will not work. Will save people a lot of time figuring out why this is not working.
Or add this to the documentation (https://docs.marimo.io/guides/working_with_data/dataframes/#selecting-dataframes.)
Proper fix: ??? If you guide me a bit I can try to create a fix and PR
Will you submit a PR?
- Yes
Environment
Details
# marimo env
{
"marimo": "0.19.6",
"editable": false,
"location": "/usr/local/lib/python3.13/site-packages/marimo",
"OS": "Linux",
"OS Version": "6.6.87.2-microsoft-standard-WSL2",
"Processor": "",
"Python Version": "3.13.11",
"Locale": "C",
"Binaries": {
"Browser": "--",
"Node": "--"
},
"Dependencies": {
"click": "8.3.1",
"docutils": "0.22.4",
"itsdangerous": "2.2.0",
"jedi": "0.19.2",
"markdown": "3.10.1",
"narwhals": "2.15.0",
"packaging": "25.0",
"psutil": "7.2.1",
"pygments": "2.19.2",
"pymdown-extensions": "10.20.1",
"pyyaml": "6.0.3",
"starlette": "0.50.0",
"tomlkit": "0.14.0",
"typing-extensions": "4.15.0",
"uvicorn": "0.40.0",
"websockets": "16.0"
},
"Optional Dependencies": {
"loro": "1.10.3",
"pandas": "2.3.3",
"pyarrow": "22.0.0"
},
"Experimental Flags": {}
}
Code to reproduce
import marimo
__generated_with = "0.19.6"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
import pandas as pd
return mo, pd
@app.cell
def (pd):
# Cell 1 - create a dataframe with 51 columns
d2 = { f"K{i}": [1,2,3] for i, in enumerate(range(49))}
d = {"person": ["Alice", "Bob", "Charlie"],"age": [20, 30, 40]}
d.update(d2)
df = pd.DataFrame(d)
return (df,)
@app.cell
def _(df, mo):
#Manual Filter on age 30 or 40
table = mo.ui.table(df, selection="multi")
table
return (table,)
@app.cell
def _(table):
#Filter is not working
table.value
return
if name == "main":
app.run()