Skip to content

Commit

Permalink
Requiring pandas>=0.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihanyue committed Feb 4, 2024
1 parent d7b1177 commit 7b7da4c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1,178 deletions.
27 changes: 8 additions & 19 deletions qgrid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@
from uuid import uuid4
from six import string_types

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


class _DefaultSettings(object):

def __init__(self):
Expand Down Expand Up @@ -954,10 +943,10 @@ def should_be_stringified(col_series):
else:
self._row_styles = {}

df_json = pd_json.to_json(None, df,
orient='table',
date_format='iso',
double_precision=self.precision)
df_json = df.to_json(None,
orient='table',
date_format='iso',
double_precision=self.precision)

if update_columns:
self._interval_columns = []
Expand Down Expand Up @@ -1034,10 +1023,10 @@ def should_be_stringified(col_series):
# and then call 'to_json' again to get a new version of the table
# json that has interval columns replaced with text columns
if len(self._interval_columns) > 0 or len(self._period_columns) > 0:
df_json = pd_json.to_json(None, df,
orient='table',
date_format='iso',
double_precision=self.precision)
df_json = df.to_json(None,
orient='table',
date_format='iso',
double_precision=self.precision)

self._df_json = df_json

Expand Down
5 changes: 0 additions & 5 deletions qgrid/pd_json/__init__.py

This file was deleted.

Loading

0 comments on commit 7b7da4c

Please sign in to comment.