GithubHelp home page GithubHelp logo

Comments (7)

mverleg avatar mverleg commented on June 3, 2024

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.

mverleg avatar mverleg commented on June 3, 2024

Needs documentation

from pyjson_tricks.

Jenselme avatar Jenselme commented on June 3, 2024

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.

mverleg avatar mverleg commented on June 3, 2024

That sounds like a likely explanation yes! I'll have a look

from pyjson_tricks.

mverleg avatar mverleg commented on June 3, 2024

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.

Jenselme avatar Jenselme commented on June 3, 2024

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.

mverleg avatar mverleg commented on June 3, 2024

Seems things are working, I'm going to close.

from pyjson_tricks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.