fix: prevent errors when transformations is empty
This commit is contained in:
parent
e3d9bee3b1
commit
e6f7a6b0e6
1 changed files with 19 additions and 14 deletions
|
|
@ -58,21 +58,26 @@ def source_panel(source_id: str, notebook_id=None, modal=False):
|
||||||
|
|
||||||
with c2:
|
with c2:
|
||||||
transformations = Transformation.get_all(order_by="name asc")
|
transformations = Transformation.get_all(order_by="name asc")
|
||||||
with st.container(border=True):
|
if transformations:
|
||||||
transformation = st.selectbox(
|
with st.container(border=True):
|
||||||
"Run a transformation",
|
transformation = st.selectbox(
|
||||||
transformations,
|
"Run a transformation",
|
||||||
key=f"transformation_{source.id}",
|
transformations,
|
||||||
format_func=lambda x: x.name,
|
key=f"transformation_{source.id}",
|
||||||
)
|
format_func=lambda x: x.name,
|
||||||
st.caption(transformation.description)
|
|
||||||
if st.button("Run"):
|
|
||||||
asyncio.run(
|
|
||||||
transform_graph.ainvoke(
|
|
||||||
input=dict(source=source, transformation=transformation)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
st.rerun(scope="fragment" if modal else "app")
|
st.caption(transformation.description if transformation else "")
|
||||||
|
if st.button("Run"):
|
||||||
|
asyncio.run(
|
||||||
|
transform_graph.ainvoke(
|
||||||
|
input=dict(source=source, transformation=transformation)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
st.rerun(scope="fragment" if modal else "app")
|
||||||
|
else:
|
||||||
|
st.markdown(
|
||||||
|
"No transformations created yet. Create new Transformation to use this feature."
|
||||||
|
)
|
||||||
|
|
||||||
if not model_manager.embedding_model:
|
if not model_manager.embedding_model:
|
||||||
help = (
|
help = (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue