Skip to content

Need a way to add entire rows to tables. #1111

@jeromekelleher

Description

@jeromekelleher

When adding rows to tables we do a lot of things like

tables.nodes.add_row(flags=node.flags, time=node.time, ...)

It would be simpler and more future proof if we had a keyword-only arg (that can't be supplied with any other argument), row which contains all the relevant values:

tables.nodes.add_row(row=node)

Annoyingly, we can't do this because there's some add_row methods that have mandatory positional arguments, and the others have fixed numeric values for defaults in the signatures.

We could have a new method called add(row) which does this? I'm not that keen on the name though, it's really doing the same thing as add_row, just being parameterised differently.

I guess if we're going to take the Python list analogy further, we should probably call this method append?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C APIIssue is about the C APIPython APIIssue is about the Python APIenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions