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,6 +58,7 @@ def source_panel(source_id: str, notebook_id=None, modal=False):
|
|||
|
||||
with c2:
|
||||
transformations = Transformation.get_all(order_by="name asc")
|
||||
if transformations:
|
||||
with st.container(border=True):
|
||||
transformation = st.selectbox(
|
||||
"Run a transformation",
|
||||
|
|
@ -65,7 +66,7 @@ def source_panel(source_id: str, notebook_id=None, modal=False):
|
|||
key=f"transformation_{source.id}",
|
||||
format_func=lambda x: x.name,
|
||||
)
|
||||
st.caption(transformation.description)
|
||||
st.caption(transformation.description if transformation else "")
|
||||
if st.button("Run"):
|
||||
asyncio.run(
|
||||
transform_graph.ainvoke(
|
||||
|
|
@ -73,6 +74,10 @@ def source_panel(source_id: str, notebook_id=None, modal=False):
|
|||
)
|
||||
)
|
||||
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:
|
||||
help = (
|
||||
|
|
|
|||
Loading…
Reference in a new issue