When setting the order of the grid instance in EditGrid, it fails when the columns passed are a strict subset of the columns in the grid.
Re-creating Issue
For example, the columns in the schema defined below are ("string", "floater", "inty"), and the order tuple passed is ("string", "floater"). Trying to set this to the order traitlet in AutoGrid is raising a ValueError.
import typing as ty
import pandas as pd
from pydantic import BaseModel, Field
from ipyautoui.custom.editgrid import EditGrid
class TestProperties(BaseModel):
string: str = Field(column_width=100, section="a")
floater: float = Field(1.5, column_width=70, aui_sig_fig=3, section="b")
inty: int = Field(1, section="b")
class TestGridSchema(BaseModel):
"""no default"""
__root__: ty.List[TestProperties] = Field(
[TestProperties(string="string").dict()],
format="dataframe",
)
df = pd.DataFrame([{"string": "test2", "floater": 2.2, "inty": 1}])
gr = EditGrid(schema=TestGridSchema)
display(gr)
gr.grid.order = ("string", "floater")
Issue
When setting the order of the grid instance in EditGrid, it fails when the columns passed are a strict subset of the columns in the grid.
Re-creating Issue
For example, the columns in the schema defined below are
("string", "floater", "inty")
, and the order tuple passed is("string", "floater")
. Trying to set this to theorder
traitlet in AutoGrid is raising a ValueError.Error