Skip to content

Commit c140c4b

Browse files
Merge pull request #204 from geo-engine/expression-operator-optional-outputBand
Expression: handle unspecified output band descriptor
2 parents 096aafe + b7a3c7c commit c140c4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

geoengine/workflow_builder/operators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ def to_dict(self) -> Dict[str, Any]:
676676
"outputType": self.output_type,
677677
"mapNoData": self.map_no_data,
678678
}
679-
if self.output_band:
679+
if self.output_band is not None:
680680
params["outputBand"] = self.output_band.to_api_dict().to_dict()
681681

682682
return {
@@ -693,7 +693,7 @@ def from_operator_dict(cls, operator_dict: Dict[str, Any]) -> 'Expression':
693693
raise ValueError("Invalid operator type")
694694

695695
output_band = None
696-
if "outputBand" in operator_dict["params"]:
696+
if "outputBand" in operator_dict["params"] and operator_dict["params"] is not None:
697697
output_band = RasterBandDescriptor.from_response(
698698
geoengine_openapi_client.RasterBandDescriptor.from_dict(
699699
operator_dict["params"]["outputBand"]

0 commit comments

Comments
 (0)