diff --git a/CHANGELOG.md b/CHANGELOG.md index 7463db7..145b6dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ ### Changelog + +## 2023-11-23 + +### Added +- Add EOSC Core Infrastructure Proxy demo instance at Metrics-Dev + ## Prerelease logging - Development RC phase \ No newline at end of file diff --git a/app/ingester/communityIngester.py b/app/ingester/communityIngester.py index 1fa8ab6..8999ebc 100644 --- a/app/ingester/communityIngester.py +++ b/app/ingester/communityIngester.py @@ -78,7 +78,7 @@ def ingestCommunityDataPerTenenv(cls, tenenvId, session): @classmethod def ingestCommunityData(cls, session): - + tenenvIds = session.exec("""SELECT id FROM tenenv_info""").all() # for each tenenv on database try to ingest CommunityData # from statistics_raw table diff --git a/app/routers/users.py b/app/routers/users.py index 94e4cde..9dbb71e 100644 --- a/app/routers/users.py +++ b/app/routers/users.py @@ -35,11 +35,11 @@ async def read_users_country( endDate: str = None, tenenv_id: int ): - interval_subquery = "" + interval_subquery = "WHERE tenenv_id = {0}".format(tenenv_id) if startDate and endDate: interval_subquery = """ - WHERE users.created BETWEEN '{0}' AND '{1}' - """.format(startDate, endDate) + WHERE users.created BETWEEN '{0}' AND '{1}' AND tenenv_id = {2} + """.format(startDate, endDate, tenenv_id) users_countries = session.exec( """WITH users_countries AS ( SELECT statistics_country_hashed.hasheduserid as userid, country, countrycode, count(*) as sum_count @@ -80,11 +80,11 @@ async def read_users_country_groupby( tenenv_id: int ): if group_by: - interval_subquery = "" + interval_subquery = "WHERE tenenv_id = {0}".format(tenenv_id) if startDate and endDate: interval_subquery = """ - WHERE users.created BETWEEN '{0}' AND '{1}' - """.format(startDate, endDate) + WHERE users.created BETWEEN '{0}' AND '{1}' AND tenenv_id={2} + """.format(startDate, endDate, tenenv_id) users = session.exec( """WITH users_countries AS ( SELECT statistics_country_hashed.hasheduserid as userid, country, countrycode, count(*) as sum_count @@ -114,6 +114,7 @@ async def read_users_country_groupby( GROUP BY range_date, country,countrycode ORDER BY range_date, country ) user_country_group_by + GROUP BY range_date""".format(group_by, interval_subquery, tenenv_id)).all() return users