Closed TheCedarPrince closed 2 years ago
This is the expected behavior. In Eunomia, datetime values are stored as float numbers, the number of seconds since 1970.
It is possible to convert birth_datetime
to a date string with DATE(birth_datetime, 'unixepoch')
(Fun.date(Get.birth_datetime, "unixepoch")
in FunSQL), but this will give you back a String
, not a Date
object, so you'll have to convert it to Date
manually in Julia code. This is the issue with SQLIte, which does not have native support for datetime values. Some SQLite bindings provide a way to recognize datetime values based on the declared column type or the column name (e.g., Python), but apparently not SQLIte.jl.
Ah - sorry about that. Thought the issue was more on the FunSQL side. This is an interesting quirk I wasn't aware of in the SQLite.jl package. I'll open an issue about this on SQLite.jl side. Thanks @xitology ! Super helpful!
Hi all,
Running into a strange type issue with datetimes.
Is your feature request related to a problem? Please explain.
I am using the Eunomia sqlite database for some prototyping of ideas and for some reason, the
birth_datetime
field is misinterpreted as a Float object. Even if I tried to modify the query toFun.datetime(Get.birth_datetime)
, this results in the objects being reportedmissing
in my resulting dataframe.To Reproduce
Julia Version (i.e. output of julia -v): 1.6.1
Operating system (Mac, Linux, Windows): macOS Catalina 10.15.7
FunSQL Version: FunSQL v0.8.0
Minimum working code example that led to bug:
Expected Behavior and Actual Behavior
I expected the datetime object to be converted to a Julia
DateTime
object in Julia. Instead, the datetime is either converted to aFloat
ormissing
.