From b42c2ff951b307c39fe05ae887d7bf711e229713 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 01:05:57 +0000 Subject: [PATCH 1/2] chore(deps): bump flake8 from 6.0.0 to 6.1.0 Bumps [flake8](https://github.com/pycqa/flake8) from 6.0.0 to 6.1.0. - [Commits](https://github.com/pycqa/flake8/compare/6.0.0...6.1.0) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.dev.txt | 6 +++--- requirements.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.dev.txt b/requirements.dev.txt index 9590b5a526..1f8009ddbd 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -8,7 +8,7 @@ black==23.7.0 # via -r requirements.dev.in click==8.1.6 # via black -flake8==6.0.0 +flake8==6.1.0 # via -r requirements.dev.in isort==5.12.0 # via -r requirements.dev.in @@ -22,7 +22,7 @@ pathspec==0.11.2 # via black platformdirs==3.10.0 # via black -pycodestyle==2.10.0 +pycodestyle==2.11.0 # via flake8 -pyflakes==3.0.1 +pyflakes==3.1.0 # via flake8 diff --git a/requirements.txt b/requirements.txt index 0fdb884ed5..b1b9aa3d36 100644 --- a/requirements.txt +++ b/requirements.txt @@ -104,7 +104,7 @@ exceptiongroup==1.1.3 # via trio-websocket fabric3==1.14.post1 # via -r requirements.in -flake8==6.0.0 +flake8==6.1.0 # via -r requirements.in fonttools==4.42.0 # via matplotlib @@ -274,13 +274,13 @@ pyasn1==0.5.0 # rsa pyasn1-modules==0.3.0 # via google-auth -pycodestyle==2.10.0 +pycodestyle==2.11.0 # via flake8 pycparser==2.21 # via cffi pydata-google-auth==1.8.2 # via pandas-gbq -pyflakes==3.0.1 +pyflakes==3.1.0 # via flake8 pynacl==1.5.0 # via paramiko From 6afcca1417eccc88490ed6ff4f0e72603dd0588f Mon Sep 17 00:00:00 2001 From: David Evans Date: Mon, 11 Sep 2023 07:50:54 +0100 Subject: [PATCH 2/2] Propitiate flake8 --- .../pipeline/management/commands/outlier_reports.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openprescribing/pipeline/management/commands/outlier_reports.py b/openprescribing/pipeline/management/commands/outlier_reports.py index d7ddb9351e..329b94cfec 100644 --- a/openprescribing/pipeline/management/commands/outlier_reports.py +++ b/openprescribing/pipeline/management/commands/outlier_reports.py @@ -519,8 +519,8 @@ def __init__( numerator_column: str = "chemical", denominator_column: str = "subpara", ) -> None: - assert ( - type(to_date) == date and type(from_date) == date + assert isinstance(to_date, date) and isinstance( + from_date, date ), "date args must be dates" assert to_date > from_date, "to date must be after from date" self.from_date = from_date @@ -705,7 +705,7 @@ def _get_entity_measure_arrays(self, entity: str) -> None: print(f"Error getting BQ data for {entity}") traceback.print_stack() try: - if type(res.iloc[0]["array"]) != np.ndarray: + if not isinstance(res.iloc[0]["array"], np.ndarray): res["array"] = res["array"].apply( lambda x: np.fromstring(x[1:-1], sep=",") )