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

Improved DB Type Inference #19948

Open
d-reynol opened this issue Nov 23, 2024 · 2 comments
Open

Improved DB Type Inference #19948

d-reynol opened this issue Nov 23, 2024 · 2 comments
Labels
A-io-database Area: reading/writing to databases enhancement New feature or an improvement of an existing feature

Comments

@d-reynol
Copy link

d-reynol commented Nov 23, 2024

Description

Hi,

I noticed that the type inference code for read_database mentioned the possibility of driver-specific knowledge & lookups being needed for further refinement.

I've implemented similar logic at my day job, and I'm happy to build out that functionality here.

Before I put in the time to put together a PR, is that something that would be considered?

https://github.com/pola-rs/polars/blob/8facee942a036f3f875a5f49a51a6fc0b7611895/py-polars/polars/io/database/_executor.py#L319C9-L319C83

@d-reynol d-reynol added the enhancement New feature or an improvement of an existing feature label Nov 23, 2024
@alexander-beedie
Copy link
Collaborator

alexander-beedie commented Nov 24, 2024

Before I put in the time to put together a PR, is that something that would be considered?

I have been preparing a large commit to address this area in more depth; you can take an early look on the branch linked below. Should be ready to land it soon, but want to run it through even more testing first (think I just found a bug in the main MSSQL driver where their string and tz-aware datetime type codes get conflated, and there doesn't appear to be a workaround for it, ouch...)

https://github.com/alexander-beedie/polars/tree/enhanced-database-type-inference

@alexander-beedie alexander-beedie added the A-io-database Area: reading/writing to databases label Nov 24, 2024
@d-reynol
Copy link
Author

Great!

Depending on when you plan on merging, I can do some testing on Wednesday to give another set of eyes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io-database Area: reading/writing to databases enhancement New feature or an improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants