Просмотр исходного кода

replace deprecated is_period_dtype

Falko Schindler 1 год назад
Родитель
Сommit
cc877e7b17
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      nicegui/elements/aggrid.py
  2. 1 1
      nicegui/elements/table.py

+ 1 - 1
nicegui/elements/aggrid.py

@@ -63,7 +63,7 @@ class AgGrid(Element, component='aggrid.js', libraries=['lib/aggrid/ag-grid-comm
             return (pd.api.types.is_datetime64_any_dtype(dtype) or
                     pd.api.types.is_timedelta64_dtype(dtype) or
                     pd.api.types.is_complex_dtype(dtype) or
-                    pd.api.types.is_period_dtype(dtype))
+                    isinstance(dtype, pd.PeriodDtype))
         special_cols = df.columns[df.dtypes.apply(is_special_dtype)]
         if not special_cols.empty:
             df = df.copy()

+ 1 - 1
nicegui/elements/table.py

@@ -114,7 +114,7 @@ class Table(FilterElement, component='table.js'):
             return (pd.api.types.is_datetime64_any_dtype(dtype) or
                     pd.api.types.is_timedelta64_dtype(dtype) or
                     pd.api.types.is_complex_dtype(dtype) or
-                    pd.api.types.is_period_dtype(dtype))
+                    isinstance(dtype, pd.PeriodDtype))
         special_cols = df.columns[df.dtypes.apply(is_special_dtype)]
         if not special_cols.empty:
             df = df.copy()