@@ -108,6 +108,7 @@ def _get_props_from_array(cls, length = None) -> List[str]:
108
108
1 : ['x' ],
109
109
2 : ['x' , 'title' ]
110
110
}
111
+
111
112
return cls ._get_props_from_array_helper (prop_list , length )
112
113
113
114
def to_array (self , force_object = False ) -> List | Dict :
@@ -128,23 +129,7 @@ def to_array(self, force_object = False) -> List | Dict:
128
129
:returns: The array representation of the data point.
129
130
:rtype: :class:`list <python:list>` of values or :class:`dict <python:dict>`
130
131
"""
131
- if self .requires_js_object or force_object :
132
- return self ._to_untrimmed_dict ()
133
-
134
- if self .x is not None :
135
- x = self .x
136
- else :
137
- x = constants .EnforcedNull
138
-
139
- if self .title is not None :
140
- title = self .title
141
- else :
142
- title = constants .EnforcedNull
143
-
144
- if self .title is None :
145
- return [x ]
146
-
147
- return [x , title ]
132
+ return self ._to_untrimmed_dict ()
148
133
149
134
@classmethod
150
135
def _get_kwargs_from_dict (cls , as_dict ):
@@ -212,6 +197,18 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict:
212
197
213
198
214
199
class FlagDataCollection (DataPointCollection ):
200
+
201
+ @property
202
+ def requires_js_object (self ) -> bool :
203
+ """Indicates whether or not the data point *must* be serialized to a JS literal
204
+ object or whether it can be serialized to a primitive array.
205
+
206
+ :returns: ``True`` if the data point *must* be serialized to a JS literal object.
207
+ ``False`` if it can be serialized to an array.
208
+ :rtype: :class:`bool <python:bool>`
209
+ """
210
+ return True
211
+
215
212
@classmethod
216
213
def _get_data_point_class (cls ):
217
214
"""The Python class to use as the underlying data point within the Collection.
0 commit comments