From 71d5c59a3372b4d135366a8509fd5ec861c7ec00 Mon Sep 17 00:00:00 2001 From: Ryan McCarthy Date: Tue, 3 Sep 2024 08:24:41 -0600 Subject: [PATCH] updating docstring and adding warning when using default_assets --- rio_tiler/io/base.py | 7 ++++++- rio_tiler/io/stac.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rio_tiler/io/base.py b/rio_tiler/io/base.py index 62e4fba5..75f8a802 100644 --- a/rio_tiler/io/base.py +++ b/rio_tiler/io/base.py @@ -497,7 +497,12 @@ def tile( if expression: assets = self.parse_expression(expression, asset_as_band=asset_as_band) - assets = assets or self.default_assets + if not assets and self.default_assets: + warnings.warn( + f"No assets/expression passed, defaults to {self.default_assets}", + UserWarning, + ) + assets = self.default_assets if not assets: raise MissingAssets( diff --git a/rio_tiler/io/stac.py b/rio_tiler/io/stac.py index 3f95b1f8..3cf76181 100644 --- a/rio_tiler/io/stac.py +++ b/rio_tiler/io/stac.py @@ -200,7 +200,7 @@ class STACReader(MultiBaseReader): exclude_assets (set of string, optional): Exclude specific assets. include_asset_types (set of string, optional): Only include some assets base on their type. exclude_asset_types (set of string, optional): Exclude some assets base on their type. - default_assets (set of string, optional): Default assets to use if none are defined. + default_assets (list of string, optional): Default assets to use if none are defined. reader (rio_tiler.io.BaseReader, optional): rio-tiler Reader. Defaults to `rio_tiler.io.Reader`. reader_options (dict, optional): Additional option to forward to the Reader. Defaults to `{}`. fetch_options (dict, optional): Options to pass to `rio_tiler.io.stac.fetch` function fetching the STAC Items. Defaults to `{}`.