Skip to content

Commit

Permalink
revert failure tests
Browse files Browse the repository at this point in the history
  • Loading branch information
solomon-negusse committed Jul 18, 2024
1 parent cb9f7d3 commit 310ce3e
Showing 1 changed file with 35 additions and 36 deletions.
71 changes: 35 additions & 36 deletions lambdas/list_tiled_analysis/src/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,38 @@

@xray_recorder.capture("Tiled Analysis")
def handler(event, context):
raise NameError("foo")
# try:
# LOGGER.info(f"Running analysis with parameters: {event}")

# query = event["query"]
# fid = event.get("fid", None)
# geojson = mapping(loads(bytes.fromhex(event["geometry"])))
# data_environment = DataEnvironment(layers=event["data_environment"])

# LOGGER.info(f"Executing query: {query}")
# LOGGER.info(f"On geometry: {geojson}")

# tiler = AnalysisTiler(query, geojson, context.aws_request_id, data_environment)
# tiler.execute()

# results = tiler.result_as_dict()

# LOGGER.info("Successfully merged tiled results")
# response = {"status": "success", "data": results}
# if fid:
# response["fid"] = fid

# return response
# except QueryParseException as e:
# response = {"status": "failed", "message": str(e)}
# if fid:
# response["fid"] = fid

# return response
# except Exception as e:
# LOGGER.exception(e)
# response = {"status": "error", "message": str(e)}
# if fid:
# response["fid"] = fid

# return response
try:
LOGGER.info(f"Running analysis with parameters: {event}")

query = event["query"]
fid = event.get("fid", None)
geojson = mapping(loads(bytes.fromhex(event["geometry"])))
data_environment = DataEnvironment(layers=event["data_environment"])

LOGGER.info(f"Executing query: {query}")
LOGGER.info(f"On geometry: {geojson}")

tiler = AnalysisTiler(query, geojson, context.aws_request_id, data_environment)
tiler.execute()

results = tiler.result_as_dict()

LOGGER.info("Successfully merged tiled results")
response = {"status": "success", "data": results}
if fid:
response["fid"] = fid

return response
except QueryParseException as e:
response = {"status": "failed", "message": str(e)}
if fid:
response["fid"] = fid

return response
except Exception as e:
LOGGER.exception(e)
response = {"status": "error", "message": str(e)}
if fid:
response["fid"] = fid

return response

0 comments on commit 310ce3e

Please sign in to comment.