-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Date
objects serialized by toRecords
fail instanceof Date
check
#236
Comments
|
Hey @Bidek56, thanks for taking a look! I'd be fine with that being the case (everything serialized to ISO date string), but today it seems like we're in a strange middleground. If it were as you suggest, then the If it quacks like a Date, I'd assume it should pass But yeah making |
If you are looking for schema, I would suggest using |
@davidgovea this seems like a bug in Using alternative test runners, it all passes
|
Wow that's a weird one! 🤦 Thanks @universalmind303 Realizing that I only observed this in jest tests as well, not in production. What is it doing under the hood?! Again really appreciate the response here |
Have you tried latest version of polars?
What version of polars are you using?
Observed on 0.10, still present on
main
branchWhat operating system are you using polars on?
Mac / Linux
What node version are you using
Node 20
Describe your bug.
When
.toRecords()
returns a Date object, it failsinstanceof Date
checksWhat are the steps to reproduce the behavior?
Extended the existing test with a demonstration:
https://github.com/davidgovea/nodejs-polars/pull/3/files
What is the actual behavior?
See test run here: https://github.com/davidgovea/nodejs-polars/actions/runs/9680675801/job/26709383256
What is the expected behavior?
x instanceof Date
should be true.Have not taken a look under the hood yet, but I am happy to do so when I get a free moment. For now, I'm just paving over the issue with an additional
new Date(polarsToRecordsDate)
wrapper in my codeThe text was updated successfully, but these errors were encountered: