Skip to content

Release covidcast-indicators 0.3.43 #1872

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

Merged
merged 27 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
195e1d5
Merge pull request #1866 from cmu-delphi/bot/sync-prod-main
nolangormley Jun 27, 2023
6e0e2b0
ci: make dependabot assign reviewers
dshemetov Jun 28, 2023
05fbd38
Merge pull request #1867 from cmu-delphi/ds/dependabot
dshemetov Jun 29, 2023
7fbb72a
draft pr for header authentication
Jun 30, 2023
a2af707
add auth
minhkhul Jul 12, 2023
77504ab
add secret to ci
minhkhul Jul 12, 2023
1579fb7
secret api key name changed
minhkhul Jul 12, 2023
3c66d0b
lint
minhkhul Jul 12, 2023
5ab7cf6
lint
minhkhul Jul 12, 2023
e48ca92
fix env location
minhkhul Jul 12, 2023
c9f9d7b
fix unit test
minhkhul Jul 12, 2023
fb0f932
fix test_get_geo_signal_combos
minhkhul Jul 12, 2023
f528484
fix api_key format
minhkhul Jul 12, 2023
9ccbf0a
bug(ci): fix dependabot reviewer assignment
dshemetov Jul 13, 2023
7158ff9
Update _delphi_utils_python/tests/validator/test_datafetcher.py
minhkhul Jul 13, 2023
c24f67e
Update _delphi_utils_python/delphi_utils/validator/datafetcher.py
minhkhul Jul 13, 2023
2e4e06b
remove env
minhkhul Jul 13, 2023
51dd68f
correct api_key location to be params.json
minhkhul Jul 13, 2023
3ecdd64
lint
minhkhul Jul 13, 2023
1dcfb24
Merge pull request #1870 from cmu-delphi/ds/dependabot
dshemetov Jul 13, 2023
51dd3d8
add fake key to test
minhkhul Jul 13, 2023
3c989f6
some re-organizing of code for readability
minhkhul Jul 13, 2023
edd6dbd
lint
minhkhul Jul 13, 2023
c9266b7
Merge pull request #1868 from cmu-delphi/ln/validator
minhkhul Jul 14, 2023
7d0db21
chore: bump delphi_utils to 0.3.18
Jul 19, 2023
721f671
chore: bump covidcast-indicators to 0.3.43
Jul 19, 2023
2cb16df
[create-pull-request] automated change
dshemetov Jul 19, 2023
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.42
current_version = 0.3.43
commit = True
message = chore: bump covidcast-indicators to {new_version}
tag = False
17 changes: 17 additions & 0 deletions .github/workflows/dependabot-assignments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Dependabot auto-assign reviewer
on: pull_request

permissions:
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.CMU_DELPHI_AUTOMATION_MACHINE_DEPENDABOT_PAT }}
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Assign team to PR
run: gh pr edit "$PR_URL" --add-reviewer "cmu-delphi/code-reviewers"
env:
PR_URL: ${{github.event.pull_request.html_url}}
2 changes: 1 addition & 1 deletion _delphi_utils_python/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.17
current_version = 0.3.18
commit = True
message = chore: bump delphi_utils to {new_version}
tag = False
Expand Down
2 changes: 1 addition & 1 deletion _delphi_utils_python/delphi_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
from .nancodes import Nans
from .weekday import Weekday

__version__ = "0.3.17"
__version__ = "0.3.18"
11 changes: 7 additions & 4 deletions _delphi_utils_python/delphi_utils/validator/datafetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
import requests
import pandas as pd
import numpy as np

import covidcast
from .. import read_params
from .errors import APIDataFetchError, ValidationFailure

FILENAME_REGEX = re.compile(
r'^(?P<date>\d{8})_(?P<geo_type>\w+?)_(?P<signal>\w+)\.csv$')


def make_date_filter(start_date, end_date):
"""
Create a function to filter dates in the specified date range (inclusive).
Expand Down Expand Up @@ -110,8 +109,12 @@ def get_geo_signal_combos(data_source):

Cross references based on combinations reported available by COVIDcast metadata.
"""
params = read_params()
assert "validation" in params
api_key = ("epidata", params["validation"]["common"]["api_credentials"])
# Maps data_source name with what's in the API, lists used in case of multiple names
meta_response = requests.get("https://api.covidcast.cmu.edu/epidata/covidcast/meta")
meta_response = requests.get("https://api.covidcast.cmu.edu/epidata/covidcast/meta",
auth=api_key)
meta_response.raise_for_status()
source_signal_mappings = {i['source']:i['db_source'] for i in
meta_response.json()}
Expand Down Expand Up @@ -139,7 +142,7 @@ def get_geo_signal_combos(data_source):
elif geo_status == "unknown":
epidata_signal = requests.get(
"https://api.covidcast.cmu.edu/epidata/covidcast/meta",
params={'signal': f"{src}:{sig}"})
params={'signal': f"{src}:{sig}"}, auth=api_key)
epidata_signal.raise_for_status()
# Not an active signal
active_status = [val['active'] for i in epidata_signal.json()
Expand Down
2 changes: 1 addition & 1 deletion _delphi_utils_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

setup(
name="delphi_utils",
version="0.3.17",
version="0.3.18",
description="Shared Utility Functions for Indicators",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
7 changes: 6 additions & 1 deletion _delphi_utils_python/tests/params.json.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"test": "yes"
"test": "yes",
"validation": {
"common": {
"api_credentials": "fake_key"
}
}
}
5 changes: 2 additions & 3 deletions _delphi_utils_python/tests/validator/test_datafetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def json(self):
def raise_for_status(self):
if self.status_code != 200:
raise HTTPError()
if len(kwargs) == 0:
if len(kwargs) == 0 or list(kwargs.keys())==["auth"]:
return MockResponse([{'source': 'chng', 'db_source': 'chng'},
{'source': 'covid-act-now', 'db_source': 'covid-act-now'}], 200)
elif kwargs["params"] == {'signal': 'chng:inactive'}:
elif "params" in kwargs and kwargs["params"] == {'signal': 'chng:inactive'}:
return MockResponse([{"signals": [{"active": False}]}], 200)
else:
return MockResponse([{"signals": [{"active": True}]}], 200)
Expand Down Expand Up @@ -78,7 +78,6 @@ def test_get_geo_signal_combos(self, mock_metadata, mock_get):
"hrr", "msa", "msa",
"state"]
})

assert set(get_geo_signal_combos("chng")) == set(
[("state", "smoothed_outpatient_cli"),
("state", "smoothed_outpatient_covid"),
Expand Down
2 changes: 1 addition & 1 deletion changehc/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion claims_hosp/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion doctor_visits/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion dsew_community_profile/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion google_symptoms/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion hhs_hosp/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion nchs_mortality/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion nowcast/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion quidel_covidtest/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion sir_complainsalot/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43