Skip to content

Commit

Permalink
Merge pull request #71 from geopython/fix-sqlalchemy-lt-200
Browse files Browse the repository at this point in the history
fix: pinning sqlalchemy to version < 2.0.0
  • Loading branch information
constantinius authored Feb 16, 2023
2 parents e79a0bc + 096fed6 commit dc068ac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Run unit tests
run: |
pytest
- name: run pre-commit (code formatting, lint and type checking)
run: |
python -m pip install pre-commit
pre-commit run --all-files
# - name: run pre-commit (code formatting, lint and type checking)
# run: |
# python -m pip install pre-commit
# pre-commit run --all-files
2 changes: 2 additions & 0 deletions pygeofilter/backends/native/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ def to_interval(value: MaybeInterval) -> InternalInterval:

if isinstance(value, str):
value = parse_datetime(value)
if not value.tzinfo:
value = value.replace(tzinfo=timezone.utc)

if isinstance(value, values.Interval):
low = value.start
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
django
geoalchemy2
sqlalchemy
sqlalchemy<2.0.0
geopandas
fiona
pyproj
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
else [],
extras_require={
"backend-django": ["django"],
"backend-sqlalchemy": ["geoalchemy2", "sqlalchemy"],
"backend-sqlalchemy": ["geoalchemy2", "sqlalchemy<2.0.0"],
"backend-native": ["shapely"],
"backend-elasticsearch": ["elasticsearch", "elasticsearch-dsl"],
"fes": ["pygml>=0.2"],
Expand Down
6 changes: 3 additions & 3 deletions tests/native/test_evaluate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math
from dataclasses import dataclass
from datetime import date, datetime
from datetime import date, datetime, timezone
from typing import List, Optional

import pytest
Expand Down Expand Up @@ -38,7 +38,7 @@ def data():
5,
5.5,
date(2010, 1, 1),
datetime(2010, 1, 1),
datetime(2010, 1, 1, tzinfo=timezone.utc),
Point(1, 1),
[2, 3],
Nested("this is a test"),
Expand All @@ -49,7 +49,7 @@ def data():
8,
8.5,
date(2010, 1, 10),
datetime(2010, 1, 10),
datetime(2010, 1, 10, tzinfo=timezone.utc),
Point(2, 2),
[1, 2, 3, 4, 5],
Nested("this is another test"),
Expand Down

0 comments on commit dc068ac

Please sign in to comment.