Skip to content

Commit

Permalink
Merge branch 'develop' into actions/black
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma authored Nov 16, 2023
2 parents 331bc05 + ca9e4a9 commit 31a298c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/Unit-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,14 @@ jobs:
- name: Launch Worker
run: |
export OSM_CLIENT_ID=thisisfakeosmcliendid
export OSM_CLIENT_SECRET=thisisclientosm
export APP_SECRET_KEY=thisissecretkey
celery --app API.api_worker worker --loglevel=INFO --queues='raw_default' &
- name: Run Tests
run: |
export OSM_CLIENT_ID=thisisfakeosmcliendid
export OSM_CLIENT_SECRET=thisisclientosm
export APP_SECRET_KEY=thisissecretkey
py.test -v -s
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,20 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Run uvicorn server
run: |
export OSM_CLIENT_ID=thisisfakeosmcliendid
export OSM_CLIENT_SECRET=thisisclientosm
export APP_SECRET_KEY=thisissecretkey
uvicorn API.main:app &> uvicorn.log &
env:
PORT: 8000
- name: Run celery server
run: |
export OSM_CLIENT_ID=thisisfakeosmcliendid
export OSM_CLIENT_SECRET=thisisclientosm
export APP_SECRET_KEY=thisissecretkey
celery --app API.api_worker worker --loglevel=DEBUG &> worker.log &
- name: Run flower dashboard
run: |
Expand Down
4 changes: 2 additions & 2 deletions config.txt.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ PGDATABASE=rawdata
# for scope. Callback / Redirect URI should be set when the OAuth2 app
# is created on OSM portal. App secret key is a high-entropy string.
[OAUTH]
OSM_CLIENT_ID=0yhbzr7-e0F-DGgyxXOyq2Y4d_sYLflMzVvLIfRtxHg
OSM_CLIENT_SECRET= KI59u4PLCQFAd8Vo2oewaHNmlf2EfTcfGgwWd2VCtk8
OSM_CLIENT_ID=0yhbzr7-e0F-DGgyxXOyq2Y4d_sYLfdflMzVvLIfRtxHg
OSM_CLIENT_SECRET= KI59u4PLCQFAd8Vo2oewaHNmlf2EfTcfGgwWd2VCsdtk8
;OSM_URL=https://www.openstreetmap.org
;OSM_PERMISSION_SCOPE=read_prefs
LOGIN_REDIRECT_URI=http://raw-data-test.example.net:8000/v1/auth/callback/
Expand Down
6 changes: 0 additions & 6 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,6 @@ def get_grid_id(geom, cur):
countries = backend_match[0]
country_export = True
logging.debug(f"Using Country Export Mode with id : {countries[0]}")
else:
if int(geom_area) > int(EXPORT_MAX_AREA_SQKM):
raise ValueError(
f"""Polygon Area {int(geom_area)} Sq.KM is higher than Threshold : {EXPORT_MAX_AREA_SQKM} Sq.KM"""
)

# else:
# if int(geom_area) > int(index_threshold):
# # this will be applied only when polygon gets bigger we will be slicing index size to search
Expand Down
2 changes: 1 addition & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def get_oauth_credentials() -> tuple:
"OAUTH", "APP_SECRET_KEY"
)
login_redirect_uri = os.environ.get("LOGIN_REDIRECT_URI") or config.get(
"OAUTH", "LOGIN_REDIRECT_URI"
"OAUTH", "LOGIN_REDIRECT_URI", fallback="http://127.0.0.1:8000/v1/auth/callback"
)
scope = os.environ.get("OSM_PERMISSION_SCOPE") or config.get(
"OAUTH", "OSM_PERMISSION_SCOPE", fallback="read_prefs"
Expand Down
4 changes: 2 additions & 2 deletions src/query_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def check_exisiting_country(geom):
from
countries b
where
ST_Equals(ST_GEOMFROMGEOJSON('{geom}') ,
b.geometry)
ST_Equals(ST_SnapToGrid(ST_GEOMFROMGEOJSON('{geom}'),0.00001) ,
ST_SnapToGrid(b.geometry,0.00001))
"""
return query

Expand Down

0 comments on commit 31a298c

Please sign in to comment.