Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v7
- uses: "opensafely-core/setup-action@v1"
with:
python-version: "3.8"
python-version: "3.10"
install-just: true
- name: Check formatting, linting and import sorting
run: just check
Expand All @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v7
- uses: "opensafely-core/setup-action@v1"
with:
python-version: "3.8"
python-version: "3.10"
install-just: true
- name: Run tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.8
python: python3.10

repos:
- repo: local
Expand All @@ -24,7 +24,7 @@ repos:
require_serial: true

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.10
3.10
2 changes: 1 addition & 1 deletion analysis/query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SELECT
TableName,
ColumnName,
ColumnType,
Precision,
[Precision],
Scale,
MaxLength,
IsNullable,
Expand Down
13 changes: 6 additions & 7 deletions analysis/report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
"metadata": {},
"outputs": [],
"source": [
"import dateutil\n",
"from IPython.display import Markdown\n",
"import json\n",
"import pathlib\n",
"\n",
"import dateutil\n",
"import pandas\n",
"import pathlib"
"from IPython.display import Markdown"
]
},
{
Expand Down Expand Up @@ -127,12 +128,10 @@
"metadata": {},
"outputs": [],
"source": [
"Markdown(\n",
" f\"\"\"\n",
"Markdown(f\"\"\"\n",
"This report was run on {report_run_date:%-d %B %Y}.\n",
"It reflects the state of the database on this date.\n",
"\"\"\"\n",
")"
"\"\"\")"
]
},
{
Expand Down
15 changes: 7 additions & 8 deletions analysis/vaccination_reference_report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import dateutil\n",
"from IPython.display import Markdown\n",
"import json\n",
"import pathlib\n",
"\n",
"import dateutil\n",
"import pandas\n",
"import pathlib"
"from IPython.display import Markdown"
]
},
{
Expand Down Expand Up @@ -123,12 +124,10 @@
}
],
"source": [
"Markdown(\n",
" f\"\"\"\n",
"Markdown(f\"\"\"\n",
"This report was run on {report_run_date:%-d %B %Y}.\n",
"It reflects the state of the database on this date.\n",
"\"\"\"\n",
")"
"\"\"\")"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export VIRTUAL_ENV := env_var_or_default("VIRTUAL_ENV", ".venv")
export BIN := VIRTUAL_ENV + if os_family() == "unix" { "/bin" } else { "/Scripts" }
export PIP := BIN + if os_family() == "unix" { "/python -m pip" } else { "/python.exe -m pip" }

export DEFAULT_PYTHON := if os_family() == "unix" { "python3.8" } else { "python" }
export DEFAULT_PYTHON := if os_family() == "unix" { "python3.10" } else { "python" }


# list available commands
Expand Down Expand Up @@ -91,7 +91,7 @@ upgrade env package="": virtualenv
#!/usr/bin/env bash
set -euo pipefail

opts="--upgrade"
opts="--upgrade --strip-extras --pip-args uploaded-prior-to=P7D"
test -z "{{ package }}" || opts="--upgrade-package {{ package }}"
FORCE=true "{{ just_executable() }}" requirements-{{ env }} $opts

Expand Down
17 changes: 7 additions & 10 deletions project.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
version: "3.0"

expectations:
population_size: 1000
version: "5.0"

actions:
query:
run: >
sqlrunner:latest
sqlrunner:v1
--output output/files_for_release/rows.csv
--log-file logs/log.json
analysis/query.sql
Expand All @@ -17,7 +14,7 @@ actions:

data_dictionary_query:
run: >
sqlrunner:latest
sqlrunner:v1
--output output/files_for_release/data_dictionary.csv
--log-file logs/data_dictionary_log.json
analysis/data_dictionary_query.sql
Expand All @@ -28,7 +25,7 @@ actions:

decision_support_value_reference_query:
run: >
sqlrunner:latest
sqlrunner:v1
--output output/files_for_release/decision_support_value_reference.csv
--log-file logs/decision_support_value_reference_log.json
analysis/decision_support_value_reference_query.sql
Expand All @@ -39,7 +36,7 @@ actions:

vaccination_reference_query:
run: >
sqlrunner:latest
sqlrunner:v1
--output output/files_for_release/vaccination_reference.csv
--log-file logs/vaccination_reference_log.json
analysis/vaccination_reference_query.sql
Expand All @@ -60,7 +57,7 @@ actions:
# --output-dir=output
# write HTML reports to the `output` directory
run: >
python:latest jupyter nbconvert
python:v2 jupyter nbconvert
--execute
--no-input
--to=html
Expand All @@ -76,7 +73,7 @@ actions:

categorical_columns:
run: >
sqlrunner:latest
sqlrunner:v1
--output output/files_for_release/results_categorical_columns.csv
--dummy-data-file analysis/dummy_results.csv
analysis/query_tpp_categorical_columns.sql
Expand Down
2 changes: 1 addition & 1 deletion requirements.dev.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--constraint requirements.prod.txt
-c requirements.prod.txt

# Additional dev requirements
# To generate a requirements file that includes both prod and dev requirements, run:
Expand Down
Loading