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.

Datasets of lists of data classes / tuples don't work

See original GitHub issue

While support for data classes in arrays works fine:

dsOf(
    arrayOf(1 to 2, 3 to 4)
).show()

This doesn’t work

dsOf(
    listOf(1 to 2, 3 to 4)
).show()

The exception is:

Exception in thread "main" java.lang.UnsupportedOperationException: No Encoder found for kotlin.Pair[A,B]
- array element class: "kotlin.Pair"
- root class: "java.util.List"

I suspect this is because the encoding for lists in the schema() function of the API misses a recursive call on its subtypes somehow. Needs to be investigated though, as it would also fix Datasets of lists of Tuples I think.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
asm0deycommented, May 23, 2021

Currently, the plan is to release version 1.0 after Kotlin 1.5.20 release because a couple of things is fixed there:

  1. In 1.5.0, lambda serialization is broken and requires an additional, potentially dangerous compiler flag to WA
  2. In 1.5.20, interop with Scala may be improved, which will allow upgrading Scala to the latest minor

Thank you very much for your effort; you will be most definitely mentioned (ping me if you want something specific to be written, please) in the next post 😃

0reactions
asm0deycommented, May 24, 2021

Yes, fixed now. Yesterday Firefox told me, that it’s not secured.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data Classes in Python 3.7+ (Guide)
Data classes will not replace all uses of namedtuple . For instance, if you need your data structure to behave like a tuple,...
Read more >
A Complete Guide to Tuples in Python - Towards Data Science
Tuples are a data structure that is similar to that of lists in Python but are often lesser-known or interacted with. They share...
Read more >
python - Why am I getting tuples instead of ints when creating ...
My idea is to have a class with its attributes being the same as columns in my database table, and then I can...
Read more >
dataclasses — Data Classes — Python 3.11.1 documentation
Returns a tuple of Field objects that define the fields for this dataclass. Accepts either a dataclass, or an instance of a dataclass....
Read more >
Lists vs Tuples in Python - Stack Abuse
Lists and tuples are two of the most commonly used data structures ... We got an error that a tuple object does not...
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