question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IDs are incompatibly typed: Sometimes strings, sometimes ints

See original GitHub issue

For 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:open
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
joeldodge79commented, Apr 28, 2021

@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!

1reaction
joeldodge79commented, Apr 20, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found