Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add
nrow
andncol
#285base: main
Are you sure you want to change the base?
Add
nrow
andncol
#285Changes from 2 commits
2ff4a60
ccf71e0
27c4c48
5722256
30ee986
ca81386
f094263
acc8ac8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkamins, does this not pirate a default definition? I'm a little uncomfortable with this definition because technically
rowcount
was only meant to be called on the result ofTables.columns
, but now it "looks like" it works generically on any table. And for the most part, it probably will, but we're not really following the principles of the interface.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DataAPI.jl does not define any method for this function. Same for
ncol
- DataAPI.jl does not define any method for this function.As I have commented - it does pirate as it add the definition to
ncol
with::Any
signature. The problem is exactly what you have commented - some tables might not have a well defined row count (maybe also the same problem is forncol
). So what do you think would be best to do? What I would ideally have is some definition that works by default correctly. I think that if default errors it is not a huge problem if it does not error on "standard" tables.Maybe what we should do is:
rowcount
to be internal;nrow
andncol
only for tables defined in Tables.jl tables (rowtable
,coltable
,dictrowtable
,dictcolumntable
,table
maybe some more? - you know best)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I would prefer (only define for Tables.jl-defined tables. I'm also happy to add recommendations to the docs that table types should strongly consider implementing
nrow
/ncol
on their own table types as apart of the API.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here;
columnnames
andgetcolumn
are only technically allowed to be called on the result ofTables.columns
or on individual iterated rows fromTables.rows
, so this makes me a bit uncomfortable.