Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit cfbbc98

Browse files
committed
Drop support for old versions of pandas
In January 2023 pandas 0.2.0 is 80 months old: https://pypi.org/project/pandas/#history Before this change pytest displayed a warning: qgrid/grid.py:30 qgrid/grid.py:30 /home/maxwell-k/github.com/maxwell-k/qgridtrusted/qgrid/grid.py:30: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(pd.__version__) > LooseVersion('0.20.0'): After this change pytest displayed one fewer warning.
1 parent 9b6de91 commit cfbbc98

File tree

5 files changed

+10
-1175
lines changed

5 files changed

+10
-1175
lines changed

qgrid/grid.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@
2222
from uuid import uuid4
2323
from six import string_types
2424

25-
# versions of pandas prior to version 0.20.0 don't support the orient='table'
26-
# when calling the 'to_json' function on DataFrames. to get around this we
27-
# have our own copy of the panda's 0.20.0 implementation that we use for old
28-
# versions of pandas.
29-
from distutils.version import LooseVersion
30-
if LooseVersion(pd.__version__) > LooseVersion('0.20.0'):
31-
import pandas.io.json as pd_json
32-
else:
33-
from . import pd_json
34-
3525

3626
class _DefaultSettings(object):
3727

@@ -957,10 +947,12 @@ def should_be_stringified(col_series):
957947
else:
958948
self._row_styles = {}
959949

960-
df_json = pd_json.to_json(None, df,
961-
orient='table',
962-
date_format='iso',
963-
double_precision=self.precision)
950+
df_json = df.to_json(
951+
None,
952+
orient='table',
953+
date_format='iso',
954+
double_precision=self.precision,
955+
)
964956

965957
if update_columns:
966958
self._interval_columns = []
@@ -1037,10 +1029,10 @@ def should_be_stringified(col_series):
10371029
# and then call 'to_json' again to get a new version of the table
10381030
# json that has interval columns replaced with text columns
10391031
if len(self._interval_columns) > 0 or len(self._period_columns) > 0:
1040-
df_json = pd_json.to_json(None, df,
1041-
orient='table',
1042-
date_format='iso',
1043-
double_precision=self.precision)
1032+
df_json = df.to_json(None,
1033+
orient='table',
1034+
date_format='iso',
1035+
double_precision=self.precision)
10441036

10451037
self._df_json = df_json
10461038

qgrid/pd_json/__init__.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)