Skip to content

Kotlin Dataframe SQLite Integer cannot be cast to Boolean in Notebook #1013

Open
@jlengrand

Description

@jlengrand

I make this issue following a request from @zaleslaw on Stack Overflow.

What happens :

Given a SQLite database, with a Boolean (nullable does not change the behavior) column, directly trying to access the value throws a java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Boolean (java.lang.Integer and java.lang.Boolean are in module java.base of loader 'bootstrap').

Using indexing [""] or .get() works as expected.

Additionally, when running the same code outside of a Notebook (in a normal IntelliJ class), using direct access throws "Unresolved reference: is_active" error.

What I expect :

I expect at least to see the same (semantically understandable) type of error than in Main.kt.
Additionally, the fact that IntelliJ offers completion for the direct access makes it confusing (and is the reason I ran into the error). If this isn't possible, I'd like to not see this completion. (The completion isn't present in a non Notebook environment for me).

image

I also found property access in your documentation, so I am expecting it is possible to use it this way.

How to reproduce :

I have created a small reproduceable repository here.

Running the mainNotebook.ipynb notebook should reproduce the issue. I have also created a Main.kt file for reference.

Other. :

Note : SQLite does not have a Boolean type, and instead relies on 1s and 0s, this seems to be related.

Let me know if I can help more!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions