Skip to content

Commit 3ef6322

Browse files
authored
Merge pull request #351 from podaac/release/3.1.0
Release/3.1.0
2 parents 88c9985 + c3d02a6 commit 3ef6322

File tree

7 files changed

+894
-628
lines changed

7 files changed

+894
-628
lines changed

.github/workflows/build-pipeline.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ jobs:
172172
aws-region: us-west-2
173173

174174
- name: Get Lauchpad Token
175-
id: lambda
175+
id: launchpad_token_generator
176176
if: |
177177
github.ref == 'refs/heads/main' ||
178178
startsWith(github.ref, 'refs/heads/release')
@@ -186,6 +186,12 @@ jobs:
186186
--payload "$PAYLOAD" \
187187
$OUTPUT_FILE > /dev/null 2>&1
188188
189+
if jq -e 'has("errorMessage")' "$OUTPUT_FILE" > /dev/null; then
190+
echo "Error detected in Lambda response:"
191+
cat "$OUTPUT_FILE"
192+
exit 1
193+
fi
194+
189195
RESULT=$(jq -r '.sm_token' < "$OUTPUT_FILE")
190196
echo "::add-mask::$RESULT"
191197
echo "result=$RESULT" >> $GITHUB_OUTPUT
@@ -206,9 +212,9 @@ jobs:
206212
umm_type: 'umm-s'
207213
use_associations: 'false'
208214
env:
209-
LAUNCHPAD_TOKEN_SIT: ${{ steps.lambda.outputs.result }}
210-
LAUNCHPAD_TOKEN_UAT: ${{ steps.lambda.outputs.result }}
211-
LAUNCHPAD_TOKEN_OPS: ${{ steps.lambda.outputs.result }}
215+
LAUNCHPAD_TOKEN_SIT: ${{ steps.launchpad_token_generator.outputs.result }}
216+
LAUNCHPAD_TOKEN_UAT: ${{ steps.launchpad_token_generator.outputs.result }}
217+
LAUNCHPAD_TOKEN_OPS: ${{ steps.launchpad_token_generator.outputs.result }}
212218

213219
continue-on-error: true
214220
- name: Wait to retry publishing umm-s
@@ -230,9 +236,9 @@ jobs:
230236
umm_type: 'umm-s'
231237
use_associations: 'false'
232238
env:
233-
LAUNCHPAD_TOKEN_SIT: ${{ steps.lambda.outputs.result }}
234-
LAUNCHPAD_TOKEN_UAT: ${{ steps.lambda.outputs.result }}
235-
LAUNCHPAD_TOKEN_OPS: ${{ steps.lambda.outputs.result }}
239+
LAUNCHPAD_TOKEN_SIT: ${{ steps.launchpad_token_generator.outputs.result }}
240+
LAUNCHPAD_TOKEN_UAT: ${{ steps.launchpad_token_generator.outputs.result }}
241+
LAUNCHPAD_TOKEN_OPS: ${{ steps.launchpad_token_generator.outputs.result }}
236242
- name: Build Python Artifact
237243
run: |
238244
poetry build

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
### Security
1414

1515

16+
## [3.1.0]
17+
### Added
18+
### Changed
19+
### Deprecated
20+
### Removed
21+
### Fixed
22+
- [issue/347](https://github.com/podaac/l2ss-py/pull/347): Fixed bug causing jobs resulting in no data to be marked as failure instead of warning by allowing HarmonyExceptions to be raised instead of wrapped in a custom exception.
23+
- Fix for getting time variable when not in same subtree as lon and lat variable
24+
### Security
25+
26+
1627
## [3.0.1]
1728
### Added
1829
### Changed

podaac/subsetter/subset.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,8 @@ def subset_with_bbox(dataset: xr.Dataset, # pylint: disable=too-many-branches
894894
or (lon_path == lat_path and time_var_name is None)
895895
):
896896
subset_dictionary[lat_path] = operation
897+
elif lat_path == lon_path and len(time_var_names) == 1:
898+
subset_dictionary[lat_path] = operation
897899

898900
return_dataset = datatree_subset.where_tree(dataset, subset_dictionary, cut, pixel_subset)
899901
return return_dataset
@@ -1009,16 +1011,23 @@ def get_coordinate_variable_names(dataset: xr.Dataset,
10091011
for lat_var_name in lat_var_names:
10101012

10111013
parent_path = '/'.join(lat_var_name.split('/')[:-1]) # gives "data_20/c"
1012-
10131014
subtree = dataset[parent_path] # Gets the subtree at data_20/c
10141015
variable = dataset[lat_var_name] # Gets the latitude variable
10151016
time_name = datatree_subset.compute_time_variable_name_tree(subtree,
10161017
variable,
10171018
time_var_names)
1019+
10181020
if time_name:
10191021
time_var = f"{parent_path}/{time_name}"
10201022
time_var_names.append(time_var)
10211023

1024+
if time_name is None:
1025+
global_time_name = datatree_subset.compute_time_variable_name_tree(dataset,
1026+
variable,
1027+
time_var_names)
1028+
if global_time_name:
1029+
time_var_names.append(global_time_name)
1030+
10221031
if not time_var_names:
10231032
time_var_names.append(compute_utc_name(dataset))
10241033

podaac/subsetter/subset_harmony.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import numpy as np
3434
from harmony_service_lib import BaseHarmonyAdapter
3535
from harmony_service_lib.util import download, stage, generate_output_filename, bbox_to_geometry
36-
from harmony_service_lib.exceptions import HarmonyException
36+
from harmony_service_lib.exceptions import HarmonyException, NoDataException
3737

3838
from podaac.subsetter import subset
3939
from podaac.subsetter.subset import SERVICE_NAME
@@ -260,10 +260,19 @@ def filter_by_subtype(variables, subtype):
260260
if not np.all(np.isnan(bounding_box_array)):
261261
result.bbox = podaac_to_harmony_bbox(result_bbox)
262262
result.geometry = bbox_to_geometry(result.bbox)
263+
else:
264+
raise NoDataException("No data found after subset operation - all bounding box values are NaN.")
265+
else:
266+
raise NoDataException("No data found after subset operation - result_bbox is None.")
263267

264268
# Return the STAC record
265269
return result
270+
except HarmonyException as he:
271+
# HarmonyExceptions should be allowed to propagate up so that Harmony can handle them
272+
raise he
266273
except Exception as ex:
274+
# Catch all other exceptions, log them, and raise a custom exception
275+
self.logger.error("An error occurred while processing the item: %s", str(ex), exc_info=True)
267276
raise L2SSException(ex) from ex
268277
finally:
269278
# Clean up any intermediate resources

0 commit comments

Comments
 (0)