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

Passing a DataFrame with datetime64[us] to kdb errors #22

Closed
erichards97 opened this issue Feb 13, 2024 · 4 comments
Closed

Passing a DataFrame with datetime64[us] to kdb errors #22

erichards97 opened this issue Feb 13, 2024 · 4 comments

Comments

@erichards97
Copy link

Describe the bug
Calling a KDB function over IPC and providing a DataFrame as an argument that contains a column of datetime64[us] results in an error: TypeError: ktype cannot be inferred from Numpy dtype datetime64[us]

I imagine datetime64[ns] is the standard pandas/numpy type, however we receive us when pulling data from a SQL database using turbodbc (which we're then trying to send to KDB), and converting between the two types feels unnecessary.

To Reproduce
q('myfunction', df)
where df has a column of datetime64[us]

Expected behavior
The df to be converted to a KDB table, with column of type timestamp.

Screenshots
N/A

Desktop (please complete the following information):

  • PyKx v2.3.0

Additional context
N/A

Thanks

@erichards97
Copy link
Author

As a temporary workaround -
df['COLUMN'] = df['COLUMN'].apply(pd.Timestamp)
before passing to KDB works

@rianoc-kx
Copy link
Collaborator

We'll open a ticket internally to add support for datetime[us]

@cmccarthy1
Copy link
Collaborator

Hi @erichards97,

Yesterday we released a fix for this with our 2.4.0 version of PyKX, change to support this is here.

For full release notes see here

@erichards97
Copy link
Author

Great, thank you.

rianoc-kx pushed a commit that referenced this issue May 1, 2024
* Added implementation of kurt function (#23)

* Added implementation of sem function (#22)

* Refactored kurt and sem functions

---------

Co-authored-by: Miguel Gómez <miguel.gomez@hablapps.com>
Co-authored-by: Francisco Tórtola Vivo <francisco.tortola@hablapps.com>
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

3 participants