I’m using types and formats for the first time with Dashtable and I noticed a discrepancy in the documentation.
In the typing page is states:
datatime
: string in the form ‘YYYY-MM-DD HH:MM:SS.ssssss’ or some truncation thereof
But in the table reference (and several examples) it states:
type (one of: ‘any’, ‘numeric’, ‘text’, ‘datetime’)
What’s the correct one?
Also I don’t mean to hark on about this but the table reference is close to unusable, the only reason I noticed this was because of one of the examples.
Read the below for the columns attributes:
Attribute:
columns
Description:
Columns describes various aspects about each individual column. name
and id
are the only required parameters.
Type:
list of dict containing key(s): ‘options’, ‘type’, ‘format’, ‘editable’, ‘hidden’, ‘deletable’, ‘id’, ‘presentation’, ‘editable_name’, ‘Type’, ‘name’, ‘validation’, ‘on_change’, ‘clearable’
. Those keys have the following types:
- options: . options has the following type: list of dict containing key(s): ‘label’, ‘value’
. Those keys have the following types:
- label (number | string)
- value (number | string)
- type (one of: ‘any’, ‘numeric’, ‘text’, ‘datetime’)
- format: . format has the following type: dict containing key(s): ‘specifier’, ‘locale’, ‘prefix’, ‘nully’
. Those keys have the following types:
- specifier (string)
- locale: . locale has the following type: dict containing key(s): ‘numerals’, ‘separate_4digits’, ‘decimal’, ‘percent’, ‘symbol’, ‘grouping’, ‘group’
. Those keys have the following types:
- numerals (list of string)
- separate_4digits (boolean)
- decimal (string)
- percent (string)
- symbol (list of string)
- grouping (list of number)
- group (string)
- prefix (number)
- nully (boolean | number | component_name | dict | list)
- editable (boolean)
- hidden (boolean)
- deletable (boolean | number)
- id (string)
- presentation (one of: ‘input’, ‘dropdown’)
- editable_name (boolean | number)
- Type ()
- name (string | list of string)
- validation: . validation has the following type: dict containing key(s): ‘allow_YY’, ‘default’, ‘allow_null’
. Those keys have the following types:
- allow_YY (boolean)
- default (boolean | number | component_name | dict | list)
- allow_null (boolean)
- on_change: . on_change has the following type: dict containing key(s): ‘failure’, ‘action’
. Those keys have the following types:
- failure (one of: ‘accept’, ‘default’, ‘reject’)
- action (one of: ‘coerce’, ‘none’, ‘validate’)
- clearable (boolean)
Default Value:
There are 14 keys described at the beginning and 6 “Those keys have the following types” statements with no reference to which key they are describing. I think some of this is a formatting issue but I can’t tell.
Yeah, sorry about this. This is an issue with our auto-generating docstrings. It doesn’t handle deeply nested properties very well right now.
You may find it easier to read the annotated properties in the source code: dash-table/src/dash-table/dash/DataTable.js at a410e0969a710555e6f3f57c4df32216e56120f8 · plotly/dash-table · GitHub
These comments and property definitions are in React.js, but the Python classes (and documentation) are autogenerated from that exact definition.
2 Likes
Thanks, looks like the answer is datetime:
type: PropTypes.oneOf(['any', 'numeric', 'text', 'datetime'])
If you haven’t already I’ll file a bug when I got home against Dash Docs for using datatime
in Typing and User Input Processing | Dash for Python Documentation | Plotly