Skip to content

Pass explicit schemas for Polars dataframes based on MySQL field types - #2486

Open
rolandwalker wants to merge 1 commit into
mainfrom
RW/explicit-polars-schema-from-mysql-types
Open

rolandwalker wants to merge 1 commit into
mainfrom
RW/explicit-polars-schema-from-mysql-types

Conversation

@rolandwalker

Copy link
Copy Markdown
Contributor

Description

Pass explicit schemas for Polars dataframes based on MySQL field types.

The general idea is that since MySQL already knows the type of a returned field, we don't need to infer the type when creating dataframes.

This should in principle be faster than always inferring types from the content, though handling edge cases such as invalid-date representation also takes compute time.

However, I'm not sure it actually is faster once the edge cases are handled.

@leninworld , do you have any interest in testing this for performance as you did on #2483 ?

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the mycli/AUTHORS.txt file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

based on MySQL field types.

This should in principle be faster than always inferring types from the
content, though handling edge cases such as invalid-date representation
also takes compute time.
@rolandwalker rolandwalker self-assigned this Dec 1, 2026

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant