-
Notifications
You must be signed in to change notification settings - Fork 8
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
When using use_columns
it still reads other columns
#327
Comments
I looked into this, and we try to infer the dtype for every column (event the ones that aren't part of Now, I see several ways we could address this, but they're all breaking:
@deanm0000 I'm curious: do you ever use the @PrettyWood what are your thoughts on this ? Also, since |
We don't use Still technically breaking, but not badly, and makes it clearer that there may be a (small) bit of compute as it's a method rather than a property (can still cache the result if repeated calls are anticipated). Give the method an "include_dtype" parameter, so if the caller needs the dtype, they can opt-in to the associated overhead - otherwise return the column names as strings. def available_columns(include_dtype: bool=False) -> list[ColumnInfo] | list[str]:
... This way, you're giving the caller more options, so the initial minor breakage is less of an issue (you aren't taking away something people may need, you're allowing them to opt-in to getting the additional dtype info if needed, but by default everyone gets more speed). |
Back the the problem at hand, at a high level, in this function
could we have it say something like If selected_columns is Selected (not sure how DynamicSelection works so maybe that too) then before returning do (Warning this is psuedo code off the fly): available_columns.iter().filter(|item| selected_columns.contains(item)).collect() wait. Is In that way it doesn't need to be a breaking change to address the issue, I think. |
@deanm0000 what you're would be equivalent to solution 3: In the function you linked, With that approach I'd rather have I like the approach proposed by @alexander-beedie , as it only requires users to change a property access to a method call in their code. Since you're not using |
See here
Suppose we have an excel file that looks like this:
then run
it raises with:
It should just ignore that column since it isn't in the
use_columns
list.The work around is to tell it to make the other column a string
The text was updated successfully, but these errors were encountered: