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

fix: support pl.UInt type in nanoplot #577

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jrycw
Copy link
Collaborator

@jrycw jrycw commented Jan 9, 2025

Fix: #571

It seems the issue stems from the input being a type we didn’t anticipate. While more advanced types like pl.Enum, pl.Categorical, pl.Array, pl.List or pl.Struct could introduce additional complexity, this PR addresses the simpler part for now.

Since _str_detect() is clearly an internal function, we could consider modifying it. However, if we switch to using re.search(), the following test cases will fail:

- FAILED `tests/test_formats.py::test_fmt_nanoplot_polars_listcol` - assert [- snapshot] == [+ received]  
- FAILED `tests/test_utils_render_html.py::test_render_polars_list_col` - assert [- snapshot] == [+ received]  

If we opt not to modify _str_detect(), we need to handle uint as a numerical type, as implemented in this PR.

Additionally, I noticed that the alignment of pl.UInt might require adjustment.

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.67%. Comparing base (9366829) to head (d7be45c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #577   +/-   ##
=======================================
  Coverage   90.67%   90.67%           
=======================================
  Files          46       46           
  Lines        5381     5381           
=======================================
  Hits         4879     4879           
  Misses        502      502           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

uint dtypes not being classified as scalar values by _str_detect
1 participant