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

We loose reservation data when combining usage items #42

Open
Iain-S opened this issue Sep 10, 2024 · 1 comment
Open

We loose reservation data when combining usage items #42

Iain-S opened this issue Sep 10, 2024 · 1 comment

Comments

@Iain-S
Copy link
Contributor

Iain-S commented Sep 10, 2024

The Azure API gives us multiple usage items that have the same ID. We combine them into one item, for various reasons. The method we use to combine them can be seen here:

def combine_items(item_to_update: models.Usage, other_item: models.Usage) -> None:

If the first item we are given has no reservation id/name and any later ones do, we loose that information (as well as other info, potentially).

A quick fix would be to overwrite any NULL fields and error or warn about any conflicting fields when merging two or more usage items.

@Iain-S
Copy link
Contributor Author

Iain-S commented Sep 10, 2024

To verify that this looses info in the real world, look for usage records where there is an amortised cost but no reservation id or name.

dlpbc added a commit to alan-turing-institute/rctab-api that referenced this issue Sep 30, 2024
to address this issue:
alan-turing-institute/rctab-functions#42

tests are empty for now

 On branch tests_for_post_usage
 Changes to be committed:
	modified:   tests/test_routes/test_usage.py
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

No branches or pull requests

1 participant