Skip to content

Can I pass a list to headers? #2

@qm64

Description

@qm64

Summary: I want to pass a list of dicts as the data, and a list of keys for headers. I don't want to full list of keys in the data as headers, I want a shorter list, in a different order.

In the documentation:

The following tabular data types are supported:
...
dict of iterables (keys as columns)
...

The headers parameter requires either a special keyword (e.g., "keys"), or a dict of column keys. I already have a list of column keys. (In a bizarre complication, the code converts this dict of column keys to a list? But doesn't support a list of column keys directly? WTF?) [I agree, it's nice that the header dict is converted to a list for me.)

My header list is not always the full list of column keys, as the full data is collected first, then a decision is made on which columns to output.

A workaround is to convert my list of column keys to a dict, so the code can convert it back?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions