Comments (7)
Actually let's keep it open, there may be bugs, or more details that need serialization. But there is an experimental version that seems to work.
from pyjson_tricks.
Needs documentation
from pyjson_tricks.
Actually let's keep it open, there may be bugs,
I think I found one. I have pandas installed but no pandas dataframes in a serialized JSON with json-tricks. When I deserialize my JSON I get errors like:
~/Seafile/Exchange/tests-serialization/json_tricks/decoders.py in pandas_hook(dct)
179
--> 180 if '__pandas_dataframe__' in dct or '__pandas_series__' in dct:
181 # todo: this is experimental
182 if not getattr(pandas_hook, '_warned', False):
TypeError: argument of type 'ColorEnum' is not iterable
I think that this comes from the fact that unlike in other decoders, you don't check whether dct
is a dict before trying to process it.
from pyjson_tricks.
That sounds like a likely explanation yes! I'll have a look
from pyjson_tricks.
I think the problem was indeed that there was no check, which only comes to light when using a custom hook (because otherwise pandas is the first hook and always gets dicts). Good find!
from pyjson_tricks.
Thanks for the correction, it now works as expected! Since I don't use pandas, I can't test the serialization/deserialiation part.
from pyjson_tricks.
Seems things are working, I'm going to close.
from pyjson_tricks.
Related Issues (20)
- Tests fail assert 'ExceptionInfo' without code changes HOT 1
- JSON tricks cannot dump nan and infinity HOT 2
- Decode fail for numpy arrays with dtype=object HOT 1
- dump returns a byte value, is this normal? HOT 4
- Can't load a dumped object of class scipy.optimize.OptimizeResult HOT 6
- Serializing NaN HOT 2
- Pandas ix is deprecated since pd.__version__ > 1.0 HOT 1
- Use compressed numpy format by default in compressed mode (next major release) HOT 1
- Make `ignore_comments` not default (next major release) HOT 2
- Bug: Numpy Array with shape (0,N) not decoded correctly. HOT 1
- Allow `cls=None` in `dump`, `dumps`, `load` and `loads` HOT 2
- TypeError in Python 3.9 due to removal of encoding kwarg from json.loads HOT 5
- Add support for encoding/decoding bytestrings HOT 4
- attrs class instances that use __weakref__ cannot be decoded HOT 3
- Test failures on s390x (big endian) architecture HOT 4
- Idea/Discussion - Applying a similar technique to dictionaries and their keys? HOT 2
- Test failures on s390x (big endian) architecture with 3.17.1
- Ambiguous timezone info in datetime HOT 2
- Compressed numpy arrays are decoded as writeable=False
- Suggestion: Drop support for python < 3.7 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyjson_tricks.