Skip to content
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

importer: Remove requirement for filename and lineno metadata #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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