Skip to content

Conversation

@dnicolodi
Copy link
Collaborator

Importers have to add "filename" and "lineno" metadata entries to the
generated entries. However, these are used only by the the
bencount.core.data.entry_sortkey() sorting key function when entries
are written in the ledger.

As the Python sort implementation is guaranteed stable, this is at
best not useful and actually problematic when the source document is
sorted in reverse date order and the importer does not explicitly
takes this in account.

Implementing a sortkey() function that does not use these metadata
entries removes the need for the importers to generate them and avoids
the issue with reverse sorting of entries for the same day.

Propagate the change to the base classes and example importers.

Importers have to add "filename" and "lineno" metadata entries to the
generated entries. However, these are used only by the the
bencount.core.data.entry_sortkey() sorting key function when entries
are written in the ledger.

As the Python sort implementation is guaranteed stable, this is at
best not useful and actually problematic when the source document is
sorted in reverse date order and the importer does not explicitly
takes this in account.

Implementing a sortkey() function that does not use these metadata
entries removes the need for the importers to generate them and avoids
the issue with reverse sorting of entries for the same day.

Propagate the change to the base classes and example importers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant