Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/i2mint/tabled
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwhalen committed Feb 21, 2025
2 parents 8554d30 + 66118a9 commit d5111b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = tabled
version = 0.1.18
version = 0.1.19
url = https://github.com/i2mint/tabled
platforms = any
description_file = README.md
Expand Down
4 changes: 2 additions & 2 deletions tabled/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,12 +689,12 @@ def default(self, obj):
if isinstance(obj, pd.DataFrame):
# Using 'records' orientation to produce a list of row dictionaries.
# Pandas will also handle nested types like Timestamps.
return json.loads(obj.to_json(orient='records', date_format='iso'))
return json.loads(obj.to_json(orient="records", date_format="iso"))
# Handle pandas Series similarly.
if isinstance(obj, pd.Series):
# to_json for Series returns a JSON object (dict) keyed by the index.
# This approach ensures that any non-JSON-serializable objects are handled by pandas.
return json.loads(obj.to_json(date_format='iso'))
return json.loads(obj.to_json(date_format="iso"))
# Handle pandas Timestamp objects.
if isinstance(obj, pd.Timestamp):
if pd.isna(obj):
Expand Down

0 comments on commit d5111b2

Please sign in to comment.