Spaces:
Running
Running
Better error messages for unexpected return types.
Browse files
lynxkite-graph-analytics/src/lynxkite_graph_analytics/core.py
CHANGED
@@ -227,13 +227,13 @@ async def _execute_node(
|
|
227 |
if p.type == nx.Graph:
|
228 |
if isinstance(x, Bundle):
|
229 |
x = x.to_nx()
|
230 |
-
assert isinstance(x, nx.Graph), "Input must be a graph."
|
231 |
elif p.type == Bundle:
|
232 |
if isinstance(x, nx.Graph):
|
233 |
x = Bundle.from_nx(x)
|
234 |
elif isinstance(x, pd.DataFrame):
|
235 |
x = Bundle.from_df(x)
|
236 |
-
assert isinstance(x, Bundle), "Input must be a graph or dataframe."
|
237 |
inputs.append(x)
|
238 |
except Exception as e:
|
239 |
if not os.environ.get("LYNXKITE_SUPPRESS_OP_ERRORS"):
|
|
|
227 |
if p.type == nx.Graph:
|
228 |
if isinstance(x, Bundle):
|
229 |
x = x.to_nx()
|
230 |
+
assert isinstance(x, nx.Graph), f"Input must be a graph. Got: {x}"
|
231 |
elif p.type == Bundle:
|
232 |
if isinstance(x, nx.Graph):
|
233 |
x = Bundle.from_nx(x)
|
234 |
elif isinstance(x, pd.DataFrame):
|
235 |
x = Bundle.from_df(x)
|
236 |
+
assert isinstance(x, Bundle), f"Input must be a graph or dataframe. Got: {x}"
|
237 |
inputs.append(x)
|
238 |
except Exception as e:
|
239 |
if not os.environ.get("LYNXKITE_SUPPRESS_OP_ERRORS"):
|