Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jlengrand opened this issue Jan 9, 2025 · 1 comment
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jlengrand
Copy link

jlengrand commented Jan 9, 2025

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!

@jlengrand
Copy link
Author

BTW, I have never dived into the Dataframe codebase, nor a DB driver, but if you indicate how I can start looking into it I don't mind seeing if I can sort a solution out myself!

@zaleslaw zaleslaw self-assigned this Jan 10, 2025
@zaleslaw zaleslaw added the bug Something isn't working label Jan 10, 2025
@zaleslaw zaleslaw added this to the 0.16.0 milestone Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants