viktor-platform / viktor_table_view

Table view to be used in VIKTOR applications
MIT License
1 stars 3 forks source link

pandas>=2.0.0 unsupported #5

Open svandermeer opened 1 year ago

svandermeer commented 1 year ago
AttributeError: 'float' object has no attribute 'rint'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "viktor_connector\connector.pyx", line 295, in connector.Job.execute
  File "viktor\core.pyx", line 1926, in viktor.core._handle_job
  File "viktor\core.pyx", line 1911, in viktor.core._handle_job._handle_view
  File "viktor\views.pyx", line 2031, in viktor.views.View._wrapper
  File "C:\Users\svandermeer\viktor-apps\table-view-application\app.py", line 32, in le_view
    return TableResult(df, dataframe_colours=df_colours, n_decimals={("Number", "Column 5"): 2})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\svandermeer\viktor-apps\table-view-application\venv\Lib\site-packages\viktor_table_view\table_view.py", line 47, in __init__
    super().__init__(html=self.get_html())
                          ^^^^^^^^^^^^^^^
  File "C:\Users\svandermeer\viktor-apps\table-view-application\venv\Lib\site-packages\viktor_table_view\table_view.py", line 69, in get_html
    self.format_dataframe()
  File "C:\Users\svandermeer\viktor-apps\table-view-application\venv\Lib\site-packages\viktor_table_view\table_view.py", line 61, in format_dataframe
    self.dataframe[column_key] = self.dataframe[column_key].round(n_decimals).astype(str)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\svandermeer\viktor-apps\table-view-application\venv\Lib\site-packages\pandas\core\series.py", line 2688, in round
    result = self._values.round(decimals)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: loop of ufunc does not support argument 0 of type float which has no callable rint method