Skip to content

Commit b52a6af

Browse files
Merge pull request #62 from asfadmin/dev
Production Configuration Bug
2 parents dbb35e8 + eeb6d30 commit b52a6af

4 files changed

Lines changed: 37 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
2828
------
2929
## [1.0.8](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.7...v1.0.8)
3030
### Changed
31-
- bump asf-search to v10.0.1 for NISAR `GUNW` and `GSLC` `processingLevel` search keyword collection aliases, and ARIA-S1 GUNW Stacking support
32-
- also adds NISAR file size export support
31+
- bump asf-search to v10.0.2 for NISAR product type file sizes, urgent response now searchable with product types, and ARIA-S1 GUNW Stacking support
32+
33+
### Fixed
34+
- boolean values are properly capitalized in `python` output file
35+
3336
------
3437
## [1.0.7](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.6...v1.0.7)
3538
### Changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ujson==5.7.0
2222
uvicorn==0.21.1
2323
watchfiles==0.19.0
2424

25-
asf-search[asf-enumeration]==10.0.1
25+
asf-search[asf-enumeration]==10.0.2
2626
python-json-logger==2.0.7
2727

2828
pyshp==2.1.3

src/SearchAPI/application/application.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
import json
23

34
import os
@@ -6,7 +7,7 @@
67

78
import asf_search as asf
89
from fastapi import Depends, FastAPI, Request, HTTPException, APIRouter, UploadFile
9-
from fastapi.responses import Response, JSONResponse
10+
from fastapi.responses import RedirectResponse, Response, JSONResponse
1011
from fastapi.middleware.cors import CORSMiddleware
1112

1213
from .log_router import LoggingRoute
@@ -227,6 +228,31 @@ async def file_to_wkt(files: list[UploadFile]):
227228
headers=constants.DEFAULT_HEADERS
228229
)
229230

231+
# @router.get('/redirect/{shortName}')
232+
# async def nisar_static_layer(shortName: str, granule_id: str, cmr_token: Optional[str], cmr_host: Optional[str]='uat'):
233+
# opts = asf.ASFSearchOptions()
234+
# if cmr_token is not None:
235+
# if cmr_host == 'uat':
236+
# host = asf.INTERNAL.CMR_HOST_UAT
237+
# else:
238+
# host = asf.INTERNAL.CMR_HOST
239+
# session = asf.ASFSession(cmr_host=host).auth_with_token(cmr_token)
240+
# opts.session = session
241+
# opts.host = host
242+
# try:
243+
# granule = asf.search(
244+
# granule_list=[granule_id],
245+
# opts=opts
246+
# )[0]
247+
# except IndexError:
248+
# raise HTTPException(status_code=400, detail=f'Unable to find static layer, provided scene named "{granule_id}" not found in CMR record')
249+
250+
# static_layer = granule.get_static_layer(opts=asf.ASFSearchOptions(shortName=shortName))
251+
# if static_layer is None:
252+
# raise HTTPException(status_code=500, detail=f'Static layer not found for scene named "{granule_id}"')
253+
254+
# return RedirectResponse(static_layer.properties['url'])
255+
230256

231257
def validate_wkt(wkt: str):
232258
try:

src/SearchAPI/application/output.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,14 @@ def get_asf_search_script(
175175
) -> tuple[str, str]:
176176

177177
opts.session = None
178+
# ASFSearchOptions formatting uses json.dumps for serialization. Add proper python capitalization
179+
opts_str = str(opts).replace('true', 'True', -1).replace('false', 'False')
178180
if search_endpoint == 'param':
179181
file_name=make_filename('py', prefix='asf-search-script')
180-
output_script = asf_search_script_template.format(file_name, str(opts))
182+
output_script = asf_search_script_template.format(file_name, opts_str)
181183
else:
182184
file_name=make_filename('py', prefix='asf-search-baseline-script')
183-
output_script = asf_search_baseline_script_template.format(file_name, reference, str(opts))
185+
output_script = asf_search_baseline_script_template.format(file_name, reference, opts_str)
184186
return file_name, output_script
185187

186188
def make_filename(suffix, prefix:str = 'asf-results'):

0 commit comments

Comments
 (0)