Skip to content

Commit

Permalink
remove: remaining trace code in legacy api
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Aug 26, 2024
1 parent c1ac7ca commit f9fcdad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
12 changes: 3 additions & 9 deletions weave/legacy/weave/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@
# If this is not imported, serialization of Weave Nodes is incorrect!
from weave.legacy.weave import graph_mapper as _graph_mapper

from . import storage as _storage
from . import ref_base as _ref_base
from weave.legacy.weave import storage as _storage
from weave.legacy.weave import ref_base as _ref_base
from weave.legacy.weave import wandb_api as _wandb_api

from weave.legacy.weave import weave_internal as _weave_internal

from weave.legacy.weave import util as _util

from weave.legacy.weave import context as _context
from ...trace import weave_init as _weave_init
from ...trace import weave_client as _weave_client

# exposed as part of api
from weave.legacy.weave import weave_types as types

# needed to enable automatic numpy serialization
from . import types_numpy as _types_numpy
from weave.legacy.weave import types_numpy as _types_numpy

from weave.legacy.weave import errors
from weave.legacy.weave.decorators import weave_class, mutation, type
Expand All @@ -41,8 +39,6 @@

from weave.legacy.weave.arrow.list_ import ArrowWeaveList as WeaveList

# TODO: This is here because the op overloaded...
from weave.trace.op import op # noqa: F401

def save(node_or_obj, name=None): # type: ignore
from weave.legacy.weave.ops_primitives.weave_api import get, save
Expand Down Expand Up @@ -128,8 +124,6 @@ def from_pandas(df): # type: ignore
"_weave_internal",
"_util",
"_context",
"_weave_init",
"_weave_client",
"types",
"_types_numpy",
"errors",
Expand Down
4 changes: 1 addition & 3 deletions weave/legacy/weave/monitoring/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import asyncio
import contextlib
import contextvars
import dataclasses
import datetime
import inspect
Expand All @@ -14,11 +13,10 @@
from weave.legacy.weave import errors
from weave.legacy.weave import (
graph,
run_streamtable_span,
stream_data_interfaces
)
from weave.legacy.weave.wandb_interface.wandb_stream_table import StreamTable
from weave.trace import call_context, context as trace_context
from weave.trace import context as trace_context
from weave.trace.client_context import weave_client as weave_client_context

logger = logging.getLogger(__name__)
Expand Down
6 changes: 0 additions & 6 deletions weave/legacy/weave/op_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import copy
import inspect
import typing
from typing import Iterator, Sequence

from weave.legacy.weave import weave_types as types
from weave.legacy.weave import (
Expand All @@ -28,13 +27,8 @@
process_opdef_resolve_fn,
tagged_value_type,
)
from weave.legacy.weave.run import Run
from weave.legacy.weave.weavejs_fixes import fixup_node

if typing.TYPE_CHECKING:
from weave.trace import weave_client
from weave.legacy.weave.run_streamtable_span import RunStreamTableSpan


_no_refine: contextvars.ContextVar[bool] = contextvars.ContextVar(
"_no_refine", default=False
Expand Down
4 changes: 2 additions & 2 deletions weave/legacy/weave/op_execute.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import typing
from typing import Mapping

from weave.trace.constants import TRACE_CALL_EMOJI

if typing.TYPE_CHECKING:
from .op_def import OpDef

TRACE_CALL_EMOJI = "🍩"


def print_run_link(run):
Expand Down

0 comments on commit f9fcdad

Please sign in to comment.