Skip to content

Commit e636f7c

Browse files
committed
Replace msgspec with orjson for JSON handling and bump version to 0.9.2.2 in pyproject.toml
1 parent 712fae3 commit e636f7c

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

pydala/filesystem.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pathlib import Path
77

88
import duckdb as ddb
9-
import msgspec
9+
import orjson
1010
import pandas as pd
1111
import polars as pl
1212
import psutil
@@ -295,7 +295,8 @@ def read_json(
295295
flatten: bool = True,
296296
) -> dict | pl.DataFrame:
297297
with self.open(path) as f:
298-
data = msgspec.json.decode(f.read())
298+
# data = msgspec.json.decode(f.read())
299+
data = orjson.loads(f.read())
299300

300301
if as_dataframe:
301302
data = pl.from_dicts(data)
@@ -474,7 +475,8 @@ def write_json(
474475
data = data.arrow().to_pydict()
475476

476477
with self.open(path, "w") as f:
477-
f.write(msgspec.json.encode(data))
478+
# f.write(msgspec.json.encode(data))
479+
f.write(orjson.dumps(data))
478480

479481

480482
def write_csv(

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ dependencies = [
77
"tqdm>=4.65.0",
88
"joblib>=1.3.2",
99
"pandas>=2.0.3",
10-
"pendulum>=2.1.2",
11-
"msgspec>=0.18.4",
10+
"pendulum>=2.1.2", #"msgspec>=0.18.4",
1211
"munch>=4.0.0",
1312
"sqlglot>=23.11.2",
1413
"sqlparse>=0.5.0",
@@ -23,7 +22,7 @@ name = "pydala2"
2322
readme = "README.md"
2423
repository = "https://github.com/legout/pydala2"
2524
requires-python = ">= 3.10"
26-
version = "0.9.2.1"
25+
version = "0.9.2.2"
2726

2827
[project.optional-dependencies]
2928
legacy = ["polars-lts-cpu>=0.20.4"]

requirements-dev.lock

-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ mdurl==0.1.2
165165
# via markdown-it-py
166166
mistune==3.0.2
167167
# via nbconvert
168-
msgspec==0.18.6
169-
# via pydala2
170168
multidict==6.1.0
171169
# via aiohttp
172170
# via yarl

requirements.lock

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ joblib==1.4.2
4040
# via pydala2
4141
loguru==0.7.2
4242
# via pydala2
43-
msgspec==0.18.6
44-
# via pydala2
4543
multidict==6.1.0
4644
# via aiohttp
4745
# via yarl

0 commit comments

Comments
 (0)