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

Make data types bijective #72

Open
travis-leith opened this issue Nov 24, 2023 · 0 comments
Open

Make data types bijective #72

travis-leith opened this issue Nov 24, 2023 · 0 comments

Comments

@travis-leith
Copy link

right now, we have clear conversions from KDB types to R types, but it is not bijective so converting from R to KDB is not clear.
For example, KDB time converts to R difftime, but KDB minute also converts to R difftime.

If I send R difftime to KDB, I get a dictionary on the other side with the attributes as keys.

But this gives us a clue for a useful refactor of rkdb. Lets use custom attributes in R to construct types that rkdb can convert into proper KDB types. For exmaple, make a function like rkdb::minute() that sets the attribute and ultimate results in a minute type in KDB. On the way back, the same thing happens. It is still a difftime in R, but has this attribute indicating which KDB type it came from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant