Skip to content

Conversation

@KristijanArmeni
Copy link

Summary

This pull request adds a small fix that ensures that _get_cell returns a list rather than pl.Series if cell entry is a container dtype (pl.List or pl.Array). This makes its behavior with polars dataframes consistent with _get_cell for pandas data frames which return lists for container dtypes.

I went ahead and thought this was the best place to address #778 which surfaced as a syntax bug when running one of the gt-extras tutorials with polars. Happy to consider other solutions in case it warrants a fix elsewhere in the code base!

Changes

  • _tbl_data._get_cell: check if retrieved cell entry is either a container data type and convert to list.
  • tests/test_tbl_data.py: adds df_container_dtypes fixture and test_get_cell_container_dtypes test

Related GitHub Issues and PRs

Checklist

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