Skip to content

Commit

Permalink
fix pg8000 version to 1.16.5
Browse files Browse the repository at this point in the history
  • Loading branch information
chicco785 committed Nov 22, 2020
1 parent 5c9660a commit 3f9ceef
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ geojson = "~=2.4"
geomet = "~=0.2"
gunicorn = "~=20.0.4"
influxdb = "~=4.0"
pg8000 = ">=1.15"
pg8000 = "==1.16.5"
pymongo = "~=3.4"
pytest = "~=3.0"
pytest-cov = "~=2.7.1"
Expand Down
24 changes: 12 additions & 12 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions src/reporter/tests/docker-compose.timescale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ services:
timescale:
image: timescale/timescaledb-postgis:${TIMESCALE_VERSION}
ports:
- "54320:5432"
# Don't expose container port 5432 with the same number outside of the
# swarm. In the Travis test env, there's already a PG instance running
# on port 5432!
- "5432:5432"
networks:
- reportertests
environment:
Expand Down Expand Up @@ -40,7 +37,7 @@ services:
- USE_GEOCODING=False
- QL_DEFAULT_DB=timescale
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PORT=54320
- POSTGRES_PORT=5432
- LOGLEVEL=DEBUG

networks:
Expand Down
7 changes: 1 addition & 6 deletions src/reporter/tests/run_tests.timescale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ docker build -t smartsdk/quantumleap ../../../
docker-compose -f docker-compose.timescale.yml up -d
sleep 10

# Set Postgres port to same value as in docker-compose.timescale.yml
export POSTGRES_PORT='54320'

cd ../../../

# pytest src/reporter/ --cov-report= --cov-config=.coveragerc --cov-append --cov=src/
#pytest src/reporter/ --cov-report= --cov-config=.coveragerc --cov-append --cov=src/
# TODO: comment in above and zap line below when Timescale backend
# is fully functional.

Expand All @@ -27,8 +24,6 @@ pytest src/reporter/ \
r=$?
cd -

unset POSTGRES_PORT

docker-compose -f docker-compose.timescale.yml down -v
exit $r

Expand Down
3 changes: 2 additions & 1 deletion src/reporter/tests/test_health.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from conftest import QL_BASE_URL
from conftest import QL_BASE_URL
import pytest
import requests


def test_health_pass():
"""
At the time test starts, services are already deployed.
Expand Down
2 changes: 2 additions & 0 deletions src/translators/timescale.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ def _db_value_to_ngsi(self, db_value: Any, ngsi_type: str) -> Any:
# 2. Basic types (int, float, boolean and text). They also get converted
# back to their corresponding Python types.

# TODO with the new pg8000 PGJsonb is removed...
# it simply replace with json dumps()
@staticmethod
def _to_db_ngsi_structured_value(data: dict) -> pg8000.PGJsonb:
return pg8000.PGJsonb(data)
Expand Down

0 comments on commit 3f9ceef

Please sign in to comment.