Datasets of lists of data classes / tuples don't work
See original GitHub issueWhile 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:
- Created 2 years ago
- Comments:10
Top 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 >
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 Free
Top 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

Currently, the plan is to release version 1.0 after Kotlin 1.5.20 release because a couple of things is fixed there:
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 😃
Yes, fixed now. Yesterday Firefox told me, that it’s not secured.