Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions cirrocumulus/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@
import fsspec
import numpy as np
import pandas as pd
import pandas._libs.json as ujson
from flask import make_response
from pandas.io.json import ujson_dumps

from cirrocumulus.envir import CIRRO_DATASET_PROVIDERS

try:
_dumps = ujson.dumps
except AttributeError:
_dumps = ujson.ujson_dumps


def to_json_array(values):
"""Coerce a pandas array to something the JSON encoder can walk.
Expand All @@ -32,7 +27,7 @@ def dumps(data, **kwargs):
data = {k: to_json_array(v) for k, v in data.items()}
else:
data = to_json_array(data)
return _dumps(data, **kwargs)
return ujson_dumps(data, **kwargs)


def add_dataset_providers():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies = [
"fsspec",
"gunicorn",
"numpy",
"pandas",
"pandas>=2.2",
"pymongo",
"requests",
"scipy",
Expand Down
Loading