-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
use_arrow=True vs False: different empty dataframe result when no columns fetched #263
Comments
I wonder if we should instead raise an exception if Alternatively, at the end of
We could probably even do that preemptively before even attempting to read the data source (which may be remote and slower), but raising an exception during parameter validation seems perhaps a bit better to me. Otherwise, if we just preemptively return an empty data frame / table, then it may out of sync with a read against the actual data source, which may fail for any number of reasons. I.e., it might be better that we don't succeed when reading no geometry / columns / FID when we'd fail otherwise if any of those are true / non-empty. Thoughts? |
IMO it would make sense to error instead of returning an empty table, as that's more likely to imply user error that |
I personally wouldn't do this, as one could argue that the the current result with use_arrow=True is more correct than a "truly" empty table. Because you did read all rows, just no columns .. But certainly fine with detecting this case and raising an error. I think it will typically indeed be a user error. |
I also can't really think of use cases where reading no columns nor a geometry from a file would lead to something useful... so I agree it smells like a user error... When |
When reading no columns from a file, this results in an empty dataframe with no columns using read_dataframe, you get a different result depending on use_arrow:
Not sure what is the expected behaviour. For what it is worth, fiona seems to do the same as use_arrow=False.
Script to reproduce:
relevant output:
The text was updated successfully, but these errors were encountered: