panel icon indicating copy to clipboard operation
panel copied to clipboard

Tabulator: no table rendered when `header_filters` is set to True and a column has datetime objects

Open maximlt opened this issue 3 years ago • 0 comments

import pandas as pd, panel as pn, datetime as dt
pn.extension('tabulator')

df = pd.DataFrame({
    'datetime': [dt.datetime(2019, 1, 1, 10), dt.datetime(2020, 1, 1, 12), dt.datetime(2020, 1, 10, 13), dt.datetime(2020, 1, 15, 13)]
}, index=['idx0', 'idx1', 'idx2', 'idx3'])
table = pn.widgets.Tabulator(df, header_filters=True)
table.show()

Traceback shown in the web console:

 Uncaught Error: fromMillis requires a numerical input, but received a string with value 
    c http://localhost:52551/static/extensions/panel/bundled/datatabulator/npm/luxon/build/global/luxon.min.js:1
    t http://localhost:52551/static/extensions/panel/bundled/datatabulator/npm/luxon/build/global/luxon.min.js:1
    t http://localhost:52551/static/extensions/panel/bundled/datatabulator/npm/luxon/build/global/luxon.min.js:1
    t http://localhost:52551/static/extensions/panel/bundled/datatabulator/npm/luxon/build/global/luxon.min.js:1
    fromMillis http://localhost:52551/static/extensions/panel/bundled/datatabulator/npm/luxon/build/global/luxon.min.js:1
    T http://localhost:52551/static/extensions/panel/panel.min.js?v=3a637fd3eef0506a09b46d31b903a9c1a8476b7f040dea4f539b0e2a8d667530:52
    generateHeaderFilterElement http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:18098
    initializeColumn http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:17999
    _buildHeader http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:1895
    Column http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:1697
    _addColumn http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:670
    setColumns http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:650
    setColumns http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:648
    _buildElement http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:9666
    _create http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:9527
    Tabulator http://localhost:52551/static/extensions/panel/bundled/datatabulator/[email protected]/dist/js/tabulator.js:8723
    render http://localhost:52551/static/extensions/panel/panel.min.js?v=3a637fd3eef0506a09b46d31b903a9c1a8476b7f040dea4f539b0e2a8d667530:52
    onload http://localhost:52551/static/extensions/panel/panel.min.js?v=3a637fd3eef0506a09b46d31b903a9c1a8476b7f040dea4f539b0e2a8d667530:52

maximlt avatar Jun 27 '22 18:06 maximlt