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

Added initial interface for fetching inferred section modes #937

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

MukuFlash03
Copy link
Contributor

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 via esds interface.

  • The function takes in the cleaned section ids and the user 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.

  • Developed the test cases under TestSectionQueries.py by first generating the required sections-users list by fetching the running the intake pipeline for multiple users.

- Reused implementation done by TTAlex and incorporated into section_queries.py.
- Developed the test cases under TestSectionQueries.py by first generating the required sections-users list data.
@shankari
Copy link
Contributor

@MukuFlash03 for the record:

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.

This is not correct. It may seem that way when you focus on the server, but in the end to end system, the UUID is created when the user registers (aka signs up) using the app. All data in the system is then associated with the UUID.

Copy link
Contributor

@shankari shankari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a clean PR, so it doesn't matter this time, but next time, please submit from a separate branch in case we need to delete/recreate/squash-merge etc.

Comment on lines +85 to +86
# Fetching the timeseries entries containing both raw data and analysis data after running intake pipeline
ts_agg = esta.TimeSeries.get_aggregate_time_series()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for clarification: this doesn't actually fetch the user entries - it just fetches the appropriate access layer.

Comment on lines +41 to +42
edb.get_analysis_timeseries_db().delete_many({"user_id": self.testUUID1})
edb.get_analysis_timeseries_db().delete_many({"user_id": self.testUUID})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job cleaning this up. I am not going to insist on it this time, but in the future, you should really put these unrelated changes into a separate commit to keep the commit history clean. You can have multiple commits in a PR, and having separate commits will keep the "git blame" more relevant.

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.

2 participants