Git Product home page Git Product logo

Comments (5)

pcaldeira-md avatar pcaldeira-md commented on June 16, 2024

Could anyone take a look at this? It would be nice to be able to pass a parameter like ensure_ascii=False on the methods serializing the cloud events into a JSON format.

from sdk-python.

xSAVIKx avatar xSAVIKx commented on June 16, 2024

Hey, sorry, I seemed to miss this one. I'll try to spend some time over the next couple of days, but no ETA. PRs are very welcome though :-)

from sdk-python.

pcaldeira-md avatar pcaldeira-md commented on June 16, 2024

Great, thanks! 🙏

from sdk-python.

xSAVIKx avatar xSAVIKx commented on June 16, 2024

OK, this is unfortunately not possible right now as well as it is not possible to modify any JSON-related conversions.

I'd very much like to support ensure_ascii, but it will also require support for all the other possible parameters. And also this kinda forces both producer and consumer to be aware of ASCII encoding while in Python at least json.dumps and json.loads have ensure_ascii=True by default.

I believe SDK should support more than just a couple of params but IDK when this can be implemented. Ideally, I'd like to provide a way to just supply custom to_json and from_json implementations throughout the whole SDK. This allows for achieving any required flexibility.

from sdk-python.

MaryamTaj avatar MaryamTaj commented on June 16, 2024

@xSAVIKx I am interested in working on this issue, and I am trying to understand it a little better.
In the comment above, you mentioned that it would be ideal to have a custom to_json, and from_json implementation throughout the whole SDK. However, in the link below, doesn't the data_marshaller parameter act as a custom implementation?

:param data_marshaller: Callable function which will cast `event.data`

from sdk-python.

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.