Skip to content

Commit 35fbcc4

Browse files
committed
address feedback
1 parent 7a3138f commit 35fbcc4

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

planet/cli/orders.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ async def create(ctx, request, pretty, **kwargs):
367367
@click.option(
368368
'--fallback-bundle',
369369
required=False,
370-
help='Fallback bundle type(s) for the item if bundle is not available.',
370+
help="""Fallback bundle type(s) for the item if bundle is not available.
371+
Multiple fallback bundles can be specified as a comma-separated string.""",
371372
type=str,
372373
callback=check_bundle)
373374
@click.option('--name',

planet/order_request.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ def product(item_ids: List[str],
115115
product_bundle: Set of asset types for the catalog items.
116116
item_type: The class of spacecraft and processing characteristics
117117
for the catalog items.
118-
fallback_bundle: In case product_bundle not having
118+
fallback_bundle: In case of product_bundle not having
119119
all asset types available, which would result in failed
120-
delivery, try a fallback bundle
120+
delivery, try one or more fallback bundles. Multiple
121+
fallback bundles may be provided as a list or a comma
122+
separated string.
121123
122124
Raises:
123125
planet.specs.SpecificationException: If bundle or fallback bundle

tests/unit/test_order_request.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,18 @@ def test_sentinel_hub_collection_configuration():
411411
[
412412
('analytic_8b_udm2', 'analytic_udm2'),
413413
('analytic_8b_udm2', 'analytic_udm2,analytic_3b_udm2'),
414+
('analytic_8b_udm2', ['analytic_udm2', 'analytic_3b_udm2']),
414415
])
415416
def test_fallback_bundle_success(bundle, fallback_bundle):
416417
product = order_request.product(["20250130_035211_69_2516"],
417418
bundle,
418419
"PSScene",
419420
fallback_bundle=fallback_bundle)
420421

422+
# Ensure fallback_bundle is a string for the expected output
423+
fallback_bundle = fallback_bundle if isinstance(
424+
fallback_bundle, str) else ','.join(fallback_bundle)
425+
421426
expected = {
422427
"item_ids": ["20250130_035211_69_2516"],
423428
"item_type": "PSScene",
@@ -432,6 +437,8 @@ def test_fallback_bundle_success(bundle, fallback_bundle):
432437
('analytic_8b_udm2', ''),
433438
('analytic_8b_udm2', 'analytic_udm2;analytic_3b_udm2'),
434439
('analytic_8b_udm2', 'analytic_udm2,analytic_3b_udm2,fake_bundle'),
440+
('analytic_8b_udm2',
441+
['analytic_udm2', 'analytic_3b_udm2', 'fake_bundle']),
435442
])
436443
def test_fallback_bundle_invalid(bundle, fallback_bundle):
437444
with pytest.raises(specs.SpecificationException):

0 commit comments

Comments
 (0)