Skip to content

Commit

Permalink
Merge pull request #46 from rciam/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ioigoume authored Nov 28, 2023
2 parents 6624b48 + 2a388e2 commit 4351a97
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
### Changelog


## 2023-11-23

### Added
- Add EOSC Core Infrastructure Proxy demo instance at Metrics-Dev

## Prerelease logging
- Development RC phase
2 changes: 1 addition & 1 deletion app/ingester/communityIngester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions app/routers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4351a97

Please sign in to comment.