Added initial interface for fetching inferred section modes #937
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The task is to add interface for the functionality to fetch inferred modes data given the cleaned sections and the user ids.
This is done to support this PR for the op-admin-dashboard repository for a new feature.
Reused implementation done by TTAlex and incorporated into
section_queries.py
.The function is a part of
emissions/storage/decorations/section_queries.py
and can be accessed viaesds
interface.The function takes in the
cleaned section ids
and theuser ids
as a list of dictionaries to the function as a parameter.This input format seems relevant as each section_id will be tied to a user_id which is generated during the intake pipeline process by storing these entries into the analysis timeseries db.
If we pass a separate list of section ids and then another list of user ids, we can zip them into a combined list but may have to check whether each section ids has a user id or vice versa.
Additionally, the initial implementation by TTAlex, used the same input format too by extracting data from the returned dataframe object.
TestSectionQueries.py
by first generating the required sections-users list by fetching the running the intake pipeline for multiple users.