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

Inspecting dataframes is not configurable through Inspect.Opts's :limit #1025

Open
LostKobrakai opened this issue Nov 22, 2024 · 3 comments
Open

Comments

@LostKobrakai
Copy link

Inspecting dataframes always truncates the printed records without being affected of inspects :limit. While I can see why it's not following the default of 50, it would sometimes still be useful to see more than the currently hardcoded 5.

@billylanchantin
Copy link
Member

First, you can use Explorer.DataFrame.print/2 which does accept a :limit argument. That might get you what you need in the short term.

Second, I was gonna say I worry about a :limit option for inspect because of how we currently format things. But we actually are smart enough to wrap longer columns across multiple lines. Example (see species):

iex> Explorer.Datasets.iris
#Explorer.DataFrame<
  Polars[150 x 5]
  sepal_length f64 [5.1, 4.9, 4.7, 4.6, 5.0, ...]
  sepal_width f64 [3.5, 3.0, 3.2, 3.1, 3.6, ...]
  petal_length f64 [1.4, 1.4, 1.3, 1.5, 1.4, ...]
  petal_width f64 [0.2, 0.2, 0.2, 0.2, 0.2, ...]
  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa",
   "Iris-setosa", ...]
>

So maybe a :limit option is totally reasonable.

I happen to be in the middle of a bug bash that involves inspect. I might cover this at some point while I'm in there.

@josevalim
Copy link
Member

The issue is the default value is too high. So we can’t respect it by default and then it is impossible for us to distinguish. Perhaps pointing to print is the best option.

@LostKobrakai
Copy link
Author

Yeah, unfortunate, but I agree that using the default 50 is not a good idea.

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