Git Product home page Git Product logo

Comments (7)

aantn avatar aantn commented on June 3, 2024

I'm opening a PR fixing this. The fix is a temporary workaround - a better fix is probably appropriate.

from hikaru.

aantn avatar aantn commented on June 3, 2024

Some relevant context: kubernetes-client/python#730

from hikaru.

haxsaw avatar haxsaw commented on June 3, 2024

This is interesting; since clean_dict() is only stripping out keys with None values, it would have left alone any datetimes that were supplied to it from the initial read. That means that the underlying client is providing values that itself cannot consume. I can replicate this problem in my integration tests; I'll have a look at the PR.

from hikaru.

aantn avatar aantn commented on June 3, 2024

The problem is the roundtrip from APIServer -> Python Datatime -> APIServer. It's also worth pointing out the Hikaru doesn't have a concept of datatime fields at all, rather just str fields. Not sure if that is impacting this or not.

from hikaru.

haxsaw avatar haxsaw commented on June 3, 2024

I think we're saying the same thing here. Hikaru does nothing special regarding any field's type unless it is a nested object. So yes, it's due to the round trip, but again I find it interesting that a field that Hikaru doesn't touch is objected to when it goes back into the client that created it.

In terms of what's in the swagger, creationTimestamp's type is listed as 'string' but it's format is simply 'date-time'. I haven't been looking at format thus far as there have been few benefits in Python (int32 vs int64 for example). Even so, it appears to have something to do with timezones, and there's nothing in the format that let's us algorithmically determine that they are important. There are a few other fields that I imagine we'll run into similar problems (Quantity comes to mind), and we'll probably need solutions similar to the PR.

from hikaru.

aantn avatar aantn commented on June 3, 2024

Yeah, understood.

from hikaru.

haxsaw avatar haxsaw commented on June 3, 2024

Added to 0.5b

from hikaru.

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.