Skip to content

Commit a1f97ac

Browse files
committed
Generalize flat_graph handling in ApiTester.result
related to Open-EO/openeo-python-client#386
1 parent 8d0cc6d commit a1f97ac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

openeo_driver/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.41.0a1"
1+
__version__ = "0.41.1a1"

openeo_driver/testing.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,11 @@ def result(
272272
if isinstance(process_graph, str):
273273
# Assume it is a file name
274274
process_graph = self.load_json(process_graph, preprocess=preprocess)
275-
elif isinstance(
276-
process_graph, (openeo.DataCube, openeo.processes.ProcessBuilderBase)
277-
):
275+
elif hasattr(process_graph, "flat_graph"):
276+
# process graph API
277+
# TODO: make this a more explicit API (e.g. with mixin)
278278
process_graph = process_graph.flat_graph()
279+
assert isinstance(process_graph, dict)
279280
data = self.get_process_graph_dict(process_graph)
280281
self.set_auth_bearer_token()
281282
response = self.post(path=path, json=data)

0 commit comments

Comments
 (0)