IDs are incompatibly typed: Sometimes strings, sometimes ints
See original GitHub issueFor the Python SDK, it appears that there is some incompatible typing going on. This is for both SDK 3.1 and SDK 4.0.
Take folder_id
, for example. In the model, the id is an Optional[str]
; but in e.g. copy_look
, it requires int. These issues cause mypy to fail when using the sdk. It’s hard to know whether or not the str
and int
types are always compatible; that is, if the id is present, whether it can be safely casted to a string. To start with, it might be helpful to document this in the SDK.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
(Homework) Java Error: Incompatible Types - Stack Overflow
your problem is that you are attempting to add two strings together, when the compiler is expecting ints. A simpler solution would be...
Read more >How to Handle the Incompatible Types Error in Java - Rollbar
The Java incompatible types error happens when a value assigned to a variable or returned by a method is incompatible with the one...
Read more >A complete guide to TypeScript's never type - Zhenghao
TypeScript's never type is very under-discussed, because it's not nearly as ubiquitous or inescapable as other types. A TypeScript beginner ...
Read more >Language Guide (proto3) | Protocol Buffers - Google Developers
For string , bytes , and message fields, singular fields are compatible with repeated fields. Given serialized data of a repeated field as...
Read more >JDK-6569074 Type inference fails with bounded type ... - Bug ID
Type inference on assignment often fails if one or more of the type ... String> Set<String> set1 = newSet1(); // fails ^ Foo.java:7:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@christippett the issue of id and parent_id being advertised as strings and coming back as integers in API version 3.1 and many similar discrepancies across other models is the main motivation we released API version 4.0 which behaves correctly (says string and sends string). I’d highly recommend using 4.0
we may change the spec for 3.1 in cases like this (and advertise an integer instead of a string, we’ll never change the actual returned value as that would be a breaking change) but it’s not a high priority so, again, 4.0 is your friend 😃
wrt to #520, that actually seems to be an issue with the RTL (run time library) and a patch to fix it would be most welcome!
thanks for the report. I’m following up with the copy_look endpoint author to understand why they’re asking for an int instead of a string.