File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source D
88### Added
99- [ #453 ] ( https://github.com/plotly/dash-ag-grid/pull/453 ) Test for changelog entry
1010
11+ ### Changed
12+ - [ #452 ] ( https://github.com/plotly/dash-ag-grid/pull/452 )
13+ - Added test for ` OBJ_MAYBE_FUNCTION_OR_MAP_MAYBE_FUNCTIONS ` to test that the value is an object before parsing,
14+ - this allows for reused keys to not comply with being an object
15+
1116
1217## [ 35.2.0] - 2026-04-03
1318### Added
Original file line number Diff line number Diff line change @@ -529,24 +529,26 @@ export function DashAgGrid(props) {
529529 } ) ;
530530 }
531531 if ( OBJ_MAYBE_FUNCTION_OR_MAP_MAYBE_FUNCTIONS [ target ] ) {
532- if ( 'function' in value ) {
533- if ( typeof value . function === 'string' ) {
534- return convertMaybeFunctionNoParams ( value ) ;
535- }
536- }
537- return map ( ( v ) => {
538- if (
539- typeof v === 'object' &&
540- v !== null &&
541- ! Array . isArray ( v )
542- ) {
543- if ( typeof v . function === 'string' ) {
544- return convertMaybeFunctionNoParams ( v ) ;
532+ if ( typeof value === 'object' ) {
533+ if ( 'function' in value ) {
534+ if ( typeof value . function === 'string' ) {
535+ return convertMaybeFunctionNoParams ( value ) ;
545536 }
546- return convertCol ( v ) ;
547537 }
548- return v ;
549- } , value ) ;
538+ return map ( ( v ) => {
539+ if (
540+ typeof v === 'object' &&
541+ v !== null &&
542+ ! Array . isArray ( v )
543+ ) {
544+ if ( typeof v . function === 'string' ) {
545+ return convertMaybeFunctionNoParams ( v ) ;
546+ }
547+ return convertCol ( v ) ;
548+ }
549+ return v ;
550+ } , value ) ;
551+ }
550552 }
551553 if (
552554 COLUMN_NESTED_FUNCTIONS [ target ] &&
Original file line number Diff line number Diff line change 22
33import dash_ag_grid as dag
44from dash import Dash , html
5+ import plotly .express as px
56from . import utils
67
78def test_cd001_cell_data_types_override (enforced_locale , dash_duo ):
@@ -146,4 +147,29 @@ def test_cd002_column_types_formatting(dash_duo):
146147 input_el = dash_duo .find_element ("#grid-column-types .ag-input-field-input" )
147148 input_el .send_keys ("0.2" + Keys .ENTER )
148149
149- grid .wait_for_cell_text (0 , 1 , "0.200" )
150+ grid .wait_for_cell_text (0 , 1 , "0.200" )
151+
152+ def test_cd003_column_types_overriding (dash_duo ):
153+ df = px .data .iris ()
154+
155+ app = Dash (__name__ )
156+
157+ app .layout = html .Div (
158+ [
159+ dag .AgGrid (
160+ rowData = df .to_dict ("records" ),
161+ columnDefs = [{"field" : c } for c in df .columns ],
162+ dashGridOptions = {
163+ "dataTypeDefinitions" : {
164+ "number" : {
165+ "columnTypes" : "rightAligned" ,
166+ }
167+ }
168+ },
169+ id = 'grid'
170+ )
171+ ]
172+ )
173+
174+ dash_duo .start_server (app )
175+ grid = utils .Grid (dash_duo , "grid" )
You can’t perform that action at this time.
0 commit comments