AB-406 Part 3: Remove nullable, use offset for bulk get endpoints #341
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
AB-406 Part 3:
Remove nullable on submission offset and add index
Use offset for bulk get endpoints
The text was updated successfully, but these errors were encountered:
This commit uses the submission offset column in lowlevel to make improvements in the following queries: - Selects entry based on submission offset in high and lowlevel queries for a single recording. - Simplifies the attempt at a single query method used in PR metabrainz#337 for returning lowlevel data of multiple recordings. - Uses two queries to return highlevel data for multiple recordings.
This commit makes some small changes to load_many_high_level: - Embeds multiple defaultdict objects when structuring the data returned by queries. - Adds an exception for no data found when metadata query returns None. - Removes exceptions on rows so that missing data rows are skipped and the rest can be returned. - Fixes incorrect indexing for elements of returned rows. Change in bulk get endpoints: - Removes unnecessary function get_data_for_multiple_recordings.
In test_stats: - Includes small fix for stats unit testing to account for the submission offset. In test_data: - Adds unit tests for load_many_low_level and load_many_high_level. In test_core.py: - Updates bulk get unit tests to use load_many_low_level and load_many_high_level.
This commit removes the no data found error that is raised when there are no existing submissions for any of the recordings in load_many_low_level and load_many_high_level. Instead, these functions will now return an empty dictionary under these circumstances. This commit also adjusts unit tests accordingly.
This commit includes the following changes: - Creates a test to check the successful assingment of a submission offset when writing lowlevel data. - Removes cast gid::text when querying for max submission offset, this cast is unnecessary. - Creates an alias for max submission offset to improve clarity.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments.