Skip to content

heapq.merge() is not given selected columns #6

@ShadenSmith

Description

@ShadenSmith

If I understand correctly, the call to heapq.merge() will merge by all columns instead of the columns variable. This can be changed to:

keyfunc = lambda row: [row[column] for column in columns]
writer.writerows(heapq.merge(*rows, key=keyfunc))

Will submit a PR for this.

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