Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions burr/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from types import ModuleType
from typing import Optional

from burr import system, telemetry
from burr import system
from burr.core.persistence import PersistedStateData
from burr.integrations.base import require_plugin
from burr.log_setup import setup_logging
Expand All @@ -50,12 +50,6 @@
setup_logging(logging.INFO)


# TODO -- add this as a general callback to the CLI
def _telemetry_if_enabled(event: str):
if telemetry.is_telemetry_enabled():
telemetry.create_and_send_cli_event(event)


def _command(command: str, capture_output: bool, addl_env: dict | None = None) -> str:
"""Runs a simple command"""
if addl_env is None:
Expand Down Expand Up @@ -171,7 +165,6 @@ def _run_server(
host: str = "127.0.0.1",
backend: str = "local",
):
_telemetry_if_enabled("run_server")
# TODO: Implement server running logic here
# Example: Start a web server, configure ports, etc.
logger.info(f"Starting server on port {port}")
Expand Down Expand Up @@ -244,7 +237,6 @@ def demo_server(port: int):
@click.option("--prod", is_flag=True, help="Publish to pypi (rather than test pypi)")
@click.option("--no-wipe-dist", is_flag=True, help="Wipe the dist/ directory before building")
def build_and_publish(prod: bool, no_wipe_dist: bool):
_telemetry_if_enabled("build_and_publish")
git_root = _get_git_root()
with cd(git_root):
logger.info("Building UI -- this may take a bit...")
Expand Down Expand Up @@ -272,7 +264,6 @@ def build_and_publish(prod: bool, no_wipe_dist: bool):
@click.option("--unique-app-names", help="Use unique app names", is_flag=True)
@click.option("--no-clear-current-data", help="Don't clear current data", is_flag=True)
def generate_demo_data(s3_bucket, data_dir, unique_app_names: bool, no_clear_current_data: bool):
_telemetry_if_enabled("generate_demo_data")
git_root = _get_git_root()
# We need to add the examples directory to the path so we have all the imports
# The GPT-one relies on a local import
Expand Down
17 changes: 1 addition & 16 deletions burr/core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
cast,
)

from burr import system, telemetry, visibility
from burr import system, visibility
from burr.common import types as burr_types
from burr.core import persistence, validation
from burr.core.action import (
Expand Down Expand Up @@ -851,8 +851,6 @@ def __init__(
spawning_parent_pointer=spawning_parent_pointer,
)

# @telemetry.capture_function_usage # todo -- capture usage when we break this up into one that isn't called internally
# This will be doable when we move sequence ID to the beginning of the function https://github.com/DAGWorks-Inc/burr/pull/73
@_call_execute_method_pre_post(ExecuteMethod.step)
def step(self, inputs: Optional[Dict[str, Any]] = None) -> Optional[Tuple[Action, dict, State]]:
"""Performs a single step, advancing the state machine along.
Expand Down Expand Up @@ -1012,8 +1010,6 @@ def _process_inputs(self, inputs: Dict[str, Any], action: Action) -> Dict[str, A
)
return processed_inputs

# @telemetry.capture_function_usage
# ditto with step()
@_call_execute_method_pre_post(ExecuteMethod.astep)
async def astep(
self, inputs: Optional[Dict[str, Any]] = None
Expand Down Expand Up @@ -1198,7 +1194,6 @@ def _return_value_iterate(
)
return prior_action, result, self._state

@telemetry.capture_function_usage
@_call_execute_method_pre_post(ExecuteMethod.iterate)
def iterate(
self,
Expand Down Expand Up @@ -1245,7 +1240,6 @@ def iterate(
break
return self._return_value_iterate(halt_before, halt_after, prior_action, result)

@telemetry.capture_function_usage
@_call_execute_method_pre_post(ExecuteMethod.aiterate)
async def aiterate(
self,
Expand Down Expand Up @@ -1277,7 +1271,6 @@ async def aiterate(
if self._should_halt_iterate(halt_before, halt_after, prior_action):
break

@telemetry.capture_function_usage
@_call_execute_method_pre_post(ExecuteMethod.run)
def run(
self,
Expand Down Expand Up @@ -1306,7 +1299,6 @@ def run(
result = e.value
return result

@telemetry.capture_function_usage
@_call_execute_method_pre_post(ExecuteMethod.arun)
async def arun(
self,
Expand Down Expand Up @@ -1338,7 +1330,6 @@ async def arun(
pass
return self._return_value_iterate(halt_before, halt_after, prior_action, result)

@telemetry.capture_function_usage
def stream_result(
self,
halt_after: list[str],
Expand Down Expand Up @@ -1590,7 +1581,6 @@ def callback(
generator, self._state, process_result, callback
)

@telemetry.capture_function_usage
async def astream_result(
self,
halt_after: list[str],
Expand Down Expand Up @@ -1863,7 +1853,6 @@ async def callback(
generator, self._state, process_result, callback
)

@telemetry.capture_function_usage
@_call_execute_method_pre_post(ExecuteMethod.stream_iterate)
def stream_iterate(
self,
Expand Down Expand Up @@ -1907,7 +1896,6 @@ def stream_iterate(
if self._should_halt_iterate(halt_before, halt_after, next_action):
break

@telemetry.capture_function_usage
@_call_execute_method_pre_post(ExecuteMethod.astream_iterate)
async def astream_iterate(
self,
Expand Down Expand Up @@ -1941,7 +1929,6 @@ async def astream_iterate(
if self._should_halt_iterate(halt_before, halt_after, next_action):
break

@telemetry.capture_function_usage
def visualize(
self,
output_file_path: Optional[str] = None,
Expand Down Expand Up @@ -2730,7 +2717,6 @@ def _build_common(self) -> Application:
state_initializer=self.state_initializer,
)

@telemetry.capture_function_usage
def build(self) -> Application[StateType]:
"""Builds the application for synchronous runs.

Expand Down Expand Up @@ -2770,7 +2756,6 @@ def build(self) -> Application[StateType]:

return self._build_common()

@telemetry.capture_function_usage
async def abuild(self) -> Application[StateType]:
"""Builds the application for asynchronous runs.

Expand Down
2 changes: 0 additions & 2 deletions burr/core/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import pathlib
from typing import Any, Callable, List, Literal, Optional, Set, Tuple, Union

from burr import telemetry
from burr.core.action import Action, Condition, create_action, default
from burr.core.state import State
from burr.core.validation import BASE_ERROR_MESSAGE, assert_set
Expand Down Expand Up @@ -180,7 +179,6 @@ def get_actions_by_tag(self, tag: str) -> List[Action]:
)
return self._action_tag_map.get(tag)

@telemetry.capture_function_usage
def visualize(
self,
output_file_path: Optional[Union[str, pathlib.Path]] = None,
Expand Down
Loading
Loading