Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

Changes from PR

elijahbenizzy4455cf2d3b0d
diff --git a/docs/concepts/additional-visibility.rst b/docs/concepts/additional-visibility.rst
index 885567af..9a6fa14d 100644
--- a/docs/concepts/additional-visibility.rst
+++ b/docs/concepts/additional-visibility.rst
@@ -25,8 +25,8 @@ For the function-based API, this would look as follows:
from burr.visibility import TracingFactory
from burr.core import action
- @action(reads=['input_var'], writes=['output_var'], __tracer: TracingFactory)
- def my_action(state: State) -> Tuple[dict, State]:
+ @action(reads=['input_var'], writes=['output_var'])
+ def my_action(state: State, __tracer: TracingFactory) -> Tuple[dict, State]:
with __tracer('process_data'):
initial_data = _process_data(state['input_var'])
with __tracer('validate_data'):
@@ -68,19 +68,23 @@ For instance:
.. code-block:: python
- from burr.visibility import TracingFactory
+ from burr.visibility import TracingFactory, ArtifactLogger
from burr.core import action
- @action(reads=['input_var'], writes=['output_var'], __tracer: TracingFactory)
- def my_action(state: State) -> Tuple[dict, State]:
+ @action(reads=['input_var'], writes=['output_var'])
+ def my_action(
+ state: State,
+ __tracer: TracingFactory,
+ __logger: ArtifactLogger
+ ) -> Tuple[dict, State]:
with __tracer('process_data'):
initial_data = _process_data(state['input_var'])
with __tracer('validate_data'):
validation_results = _validate(initial_data)
t.log_artifact(validation_results=validation_results)
- with __tracer('transform_data', dependencies=['process_data']) as t:
+ with __tracer('transform_data', dependencies=['process_data'])
transformed_data = _transform(initial_data)
- t.log_artifact(transformed_data_size=len(transformed_data))
+ __logger.log_artifact(transformed_data_size=len(transformed_data))
return {'output_var': transformed_data}, state.update({'output_var': transformed_data})
diff --git a/telemetry/ui/src/components/common/href.tsx b/telemetry/ui/src/components/common/href.tsx
index c5e5e05a..6901d58f 100644
--- a/telemetry/ui/src/components/common/href.tsx
+++ b/telemetry/ui/src/components/common/href.tsx
@@ -4,7 +4,14 @@
*/
export const LinkText = (props: { href: string; text: string }) => {
return (
- <a href={props.href} className="text-dwlightblue hover:underline">
+ <a
+ href={props.href}
+ className="text-dwlightblue hover:underline"
+ onClick={(e) => {
+ // Quick trick to ensure that this takes priority and if this has a parent href, it doesn't trigger
+ e.stopPropagation();
+ }}
+ >
{props.text}
</a>
);
diff --git a/telemetry/ui/src/components/routes/ProjectList.tsx b/telemetry/ui/src/components/routes/ProjectList.tsx
index 1927761e..b332fa22 100644
--- a/telemetry/ui/src/components/routes/ProjectList.tsx
+++ b/telemetry/ui/src/components/routes/ProjectList.tsx
@@ -6,12 +6,14 @@ import { DateDisplay } from '../common/dates';
import { Button } from '../common/button';
import { Chip } from '../common/chip';
import { LinkText } from '../common/href';
+import { useNavigate } from 'react-router-dom';
/**
* Table of a project list. Uses the tailwind catalyst component.
* This does not load or fetch any data, just renders it
*/
export const ProjectListTable = (props: { projects: Project[] }) => {
+ const navigate = useNavigate();
const projectsCopy = [...props.projects];
const projectsSorted = projectsCopy.sort((a, b) => {
return a.last_written > b.last_written ? -1 : 1;
@@ -44,7 +46,7 @@ export const ProjectListTable = (props: { projects: Project[] }) => {
<TableRow
key={project.id}
className="hover:bg-gray-50 cursor-pointer"
- href={`/project/${project.id}`}
+ onClick={() => navigate(`/project/${project.id}`)}
>
<TableCell className="font-semibold text-gray-700">
<div className="flex flex-row gap-2">