Skip to content

Commit

Permalink
Move separtor component to components.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam-singhal committed Jan 27, 2025
1 parent e042c59 commit 7cfca43
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions preswald/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
image,
plotly,
workflow_dag,
separator,
)
from .data import view, query, summary, save, load
from .state import Workflow, RetryPolicy, WorkflowAnalyzer
9 changes: 8 additions & 1 deletion preswald/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,4 +472,11 @@ def workflow_dag(workflow, title="Workflow Dependency Graph"):
"error": f"Failed to create DAG visualization: {str(e)}"
}
_rendered_html.append(error_component)
return error_component
return error_component

# Add separator component function
def separator():
"""Create a separator component that forces a new row."""
component = {"type": "separator", "id": str(uuid.uuid4())}
_rendered_html.append(component)
return component
8 changes: 1 addition & 7 deletions preswald/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Dict, Any, Callable, List
import logging
import uuid
import threading
import asyncio
import time
Expand Down Expand Up @@ -279,9 +278,4 @@ def get_rendered_components():
return {"rows": rows}


# Add separator component function
def separator():
"""Create a separator component that forces a new row."""
component = {"type": "separator", "id": str(uuid.uuid4())}
_rendered_html.append(component)
return component

0 comments on commit 7cfca43

Please sign in to comment.