Comments (7)
I'm opening a PR fixing this. The fix is a temporary workaround - a better fix is probably appropriate.
from hikaru.
Some relevant context: kubernetes-client/python#730
from hikaru.
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.
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.
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.
Yeah, understood.
from hikaru.
Added to 0.5b
from hikaru.
Related Issues (20)
- Generated code not using 'body' argument in 'deleteCollection' methods HOT 1
- Add a 'merge()' method to HikaruBase HOT 1
- CRUD-style support HOT 4
- Wrong object type created despite calling hikaru.register_version_kind_class HOT 5
- Black maybe better be a dev dependency HOT 5
- Node from_dict fails on required field port (in DeamonEndpoint) HOT 3
- List methods aren't assigned to classes consistently HOT 4
- obj.metadata.selfLink is always None HOT 3
- convert underscore to dash implicitely in _clean_dict may introduce in un-expected labels HOT 5
- Hikaru functions should return a specific type HOT 3
- support for auto-generation HOT 4
- VolumeSnapshot missing HOT 11
- deserialize/serialize yaml preserving comments and formatting HOT 1
- Support for Argo Workflows? HOT 4
- Support for K8s v1.25 HOT 5
- Unpin Black version HOT 2
- PodStatus's podIP and hostIP attributes are not set on readNamespacedPod(...) HOT 3
- Import errors HOT 2
- Support dictionary lookups in object_at_path HOT 3
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 hikaru.