Skip to content

Commit

Permalink
move to legacy: errors (and add relevant errors to trace)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Aug 27, 2024
1 parent 2d71d49 commit 0511abc
Show file tree
Hide file tree
Showing 92 changed files with 294 additions and 292 deletions.
2 changes: 1 addition & 1 deletion weave/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .legacy.api import *
from .trace.api import *

from .errors import *
from .legacy.errors import *

from weave.legacy import mappers_python_def

Expand Down
2 changes: 1 addition & 1 deletion weave/client_context/weave_client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import threading
from typing import TYPE_CHECKING, Optional

from weave.errors import WeaveInitError
from weave.legacy import context_state
from weave.legacy.errors import WeaveInitError

if TYPE_CHECKING:
from weave.trace.weave_client import WeaveClient
Expand Down
171 changes: 0 additions & 171 deletions weave/errors.py

This file was deleted.

4 changes: 2 additions & 2 deletions weave/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from aiofiles.threadpool import binary as aiofiles_binary
from aiofiles.threadpool import text as aiofiles_text

from weave.legacy import cache, engine_trace, environment
from weave.legacy import cache, engine_trace, environment, errors

from . import errors, util
from . import util

tracer = engine_trace.tracer() # type: ignore
async_utime = aiofiles_os.wrap(os.utime) # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/_dict_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from weave.legacy import box
from weave.legacy.language_features.tagging import tag_store, tagged_value_type

from .. import errors
from weave.legacy import errors
from .. import weave_types as types


Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# needed to enable automatic numpy serialization
from . import types_numpy as _types_numpy

from .. import errors
from weave.legacy import errors
from weave.legacy.decorators import weave_class, mutation, type

from weave.legacy import usage_analytics
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/arrow/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

py_type = type

from weave import errors
from weave.legacy import errors
from weave import weave_types as types
from weave.legacy import artifact_fs, partial_object

Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/arrow/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pyarrow as pa
from pyarrow import compute as pc

from weave import errors
from weave.legacy import errors
from weave import weave_types as types
from weave.legacy.arrow.list_ import (
ArrowWeaveList,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/arrow/constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pyarrow as pa

from weave import errors
from weave.legacy import errors
from weave import weave_types as types
from weave.legacy import artifact_base, box
from weave.legacy.arrow import arrow_tags, convert
Expand Down
4 changes: 2 additions & 2 deletions weave/legacy/arrow/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import pyarrow.compute as pc

from weave.legacy import api as api
from weave import errors, weave_internal
from weave import weave_internal
from weave import weave_types as types
from weave.legacy import arrow_util, artifact_base, artifact_mem, box, mappers_arrow
from weave.legacy import errors, arrow_util, artifact_base, artifact_mem, box, mappers_arrow
from weave.legacy.arrow.arrow import (
ArrowWeaveListType,
)
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/arrow/list_.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import typing_extensions

from weave import (
errors,
weave_internal,
)
from weave import weave_types as types
from weave.legacy import (
errors,
_dict_utils,
artifact_base,
box,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/artifact_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import typing

from weave import errors
from weave.legacy import errors
from weave import weave_types as types
from weave.legacy import artifact_base, file_base, object_context, ref_base, uris
from weave.legacy.language_features.tagging import tag_store
Expand Down
12 changes: 10 additions & 2 deletions weave/legacy/artifact_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
import typing
from datetime import datetime

from weave import errors, filesystem, util
from weave import filesystem, util
from weave import weave_types as types
from weave.legacy import artifact_fs, artifact_wandb, environment, file_base, file_util, uris
from weave.legacy import (
artifact_fs,
artifact_wandb,
environment,
errors,
file_base,
file_util,
uris,
)

WORKING_DIR_PREFIX = "__working__"

Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/artifact_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from . import artifact_base
from weave import weave_types as types
from weave import errors
from weave.legacy import errors
from weave.legacy import ref_base


Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/artifact_wandb.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
from wandb.sdk.lib.hashutil import b64_to_hex_id, hex_to_b64_id

from weave import (
errors,
filesystem,
urls,
util,
)
from weave import weave_types as types
from weave.legacy import (
errors,
engine_trace,
artifact_fs,
eager,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import time
import typing

from weave import errors
from weave.legacy import errors
from weave.legacy import context_state, environment, wandb_api, engine_trace

statsd = engine_trace.statsd() # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import typing

from weave import (
errors,
weave_internal,
)
from weave import weave_types as types
from weave.legacy import (
errors,
engine_trace,
box,
compile_domain,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/compile_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import graphql

from weave import errors
from weave.legacy import errors
from weave import weave_types as types
from weave.legacy import gql_op_plugin, gql_to_weave, graph, op_args, stitch, registry_mem
from weave.legacy.input_provider import InputAndStitchProvider
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/compile_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import typing

from weave import errors
from weave.legacy import errors
from weave.legacy import stitch

KeyTree = typing.Dict[str, "KeyTree"] # type:ignore
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/decorator_class.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import inspect
import typing

from weave import errors
from weave.legacy import errors
from weave import weave_types as types
from weave.legacy import context_state, derive_op, op_def, registry_mem

Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/decorator_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import inspect
import typing

from weave import errors
from weave.legacy import errors
from weave import weave_types as types
from weave.legacy import context_state, decorator_class, object_type_ref_util, infer_types

Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/derive_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import typing

from weave import (
errors,
storage,
weave_internal,
)
from weave import weave_types as types
from weave.legacy import (
errors,
parallelism,
registry_mem,
box,
Expand Down
Loading

0 comments on commit 0511abc

Please sign in to comment.