Skip to content

Commit aeba869

Browse files
committed
Revert "Revert "TEST - Build and image with new Flask and SQLAlchemy" (#974)"
This reverts commit e47ca86. reverting my old revert... ugh, sorry, ive made a mess of this repository :( this restores the rest of the version bumps we updated previously
1 parent 299d93a commit aeba869

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

devops/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ WORKDIR /src
33
COPY . /src
44
RUN npm ci && npm run build
55

6-
FROM tiangolo/meinheld-gunicorn:python3.7
6+
FROM tiangolo/meinheld-gunicorn:python3.8
77
LABEL org.opencontainers.image.source=https://github.com/cmu-delphi/delphi-epidata
88
# use delphi's timezome
99
RUN ln -s -f /usr/share/zoneinfo/America/New_York /etc/localtime
1010

11-
COPY requirements.txt /app
12-
RUN pip install --no-cache-dir -r requirements.txt
11+
COPY requirements.txt /app/requirements_also.txt
12+
RUN pip install --no-cache-dir -r /tmp/requirements.txt -r requirements_also.txt
13+
# the file /tmp/requirements.txt is created in the parent docker definition. (see:
14+
# https://github.com/tiangolo/meinheld-gunicorn-docker/blob/master/docker-images/python3.8.dockerfile#L5 )
15+
# this combined requirements installation ensures all version constrants are accounted for.
1316

1417
# disable python stdout buffering
1518
ENV PYTHONUNBUFFERED 1

src/server/_query.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
)
1515

1616
from sqlalchemy import text
17-
from sqlalchemy.engine import RowProxy
17+
from sqlalchemy.engine import Row
1818

1919
from ._common import db, app
2020
from ._db import metadata
@@ -197,7 +197,7 @@ def filter_pair(pair: TimePair, i) -> str:
197197

198198

199199
def parse_row(
200-
row: RowProxy,
200+
row: Row,
201201
fields_string: Optional[Sequence[str]] = None,
202202
fields_int: Optional[Sequence[str]] = None,
203203
fields_float: Optional[Sequence[str]] = None,
@@ -245,7 +245,7 @@ def run_query(p: APrinter, query_tuple: Tuple[str, Dict[str, Any]]):
245245
return db.execution_options(stream_results=True).execute(full_query, **params)
246246

247247

248-
def _identity_transform(row: Dict[str, Any], _: RowProxy) -> Dict[str, Any]:
248+
def _identity_transform(row: Dict[str, Any], _: Row) -> Dict[str, Any]:
249249
"""
250250
identity transform
251251
"""
@@ -257,7 +257,7 @@ def execute_queries(
257257
fields_string: Sequence[str],
258258
fields_int: Sequence[str],
259259
fields_float: Sequence[str],
260-
transform: Callable[[Dict[str, Any], RowProxy], Dict[str, Any]] = _identity_transform,
260+
transform: Callable[[Dict[str, Any], Row], Dict[str, Any]] = _identity_transform,
261261
):
262262
"""
263263
execute the given queries and return the response to send them
@@ -317,7 +317,7 @@ def execute_query(
317317
fields_string: Sequence[str],
318318
fields_int: Sequence[str],
319319
fields_float: Sequence[str],
320-
transform: Callable[[Dict[str, Any], RowProxy], Dict[str, Any]] = _identity_transform,
320+
transform: Callable[[Dict[str, Any], Row], Dict[str, Any]] = _identity_transform,
321321
):
322322
"""
323323
execute the given query and return the response to send it

0 commit comments

Comments
 (0)