Skip to content

Commit d89aff5

Browse files
committed
Issue #752/#755 document warning arg of ensure_band_dimension
1 parent 1aa11bb commit d89aff5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

openeo/metadata.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,14 @@ def ensure_band_dimension(
429429
This will override any existing band dimension, and is intended for
430430
special cases where pragmatism necessitates to ignore the original metadata.
431431
For example, to overrule badly/incomplete detected band names from STAC metadata.
432+
433+
.. note::
434+
It is required to specify a warning message as this method is only intended
435+
to be used as temporary stop-gap solution for use cases that are possibly not future-proof.
436+
Enforcing a warning should make that clear and avoid that users unknowingly depend on
437+
metadata handling behavior that is not guaranteed to be stable.
432438
"""
433-
_log.warning(warning)
439+
_log.warning(warning or "ensure_band_dimension: overriding band dimension metadata with user-defined bands.")
434440
if name is None:
435441
# Preserve original band dimension name if possible
436442
name = self.band_dimension.name if self.has_band_dimension() else "bands"

0 commit comments

Comments
 (0)