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

UML-3683 extra report, of users with no lpas #3048

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion query/dynamodb_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,14 @@ def get_count_of_lpas_for_users(self):
sql_string = f"SELECT countofLpasForUser as noOfLpas, count(countofLpasForUser) AS noOfUsersWithThisNoOfLpas from (SELECT count(item.userid.s) AS countofLpasForUser, item.userid.s from user_lpa_actor_map group by item.userid.s) as subquery group by countofLpasForUser order by countofLpasForUser"
self.run_athena_query(
sql_string,
outputFileName="CountOfLpasForUsers",
outputFileName="CountOfLpasForUsersWithSomeLpas",
)

def get_count_of_users_with_no_lpas(self):
sql_string = f"SELECT COUNT(item.id.s) from actor_users where item.id.s not in (select item.userid.s from user_lpa_actor_map where item.userid is not null)"
self.run_athena_query(
sql_string,
outputFileName="CountOfUsersWithNoLpas",
)

def main():
Expand Down Expand Up @@ -390,6 +397,7 @@ def main():
work.get_count_of_expired_access_codes()
work.get_organisations_field()
work.get_count_of_lpas_for_users()
work.get_count_of_users_with_no_lpas()


if __name__ == "__main__":
Expand Down
Loading