Skip to content

Commit

Permalink
move to legacy: weave_types
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Aug 28, 2024
1 parent 0c1cddd commit 2bd395f
Show file tree
Hide file tree
Showing 200 changed files with 408 additions and 411 deletions.
2 changes: 1 addition & 1 deletion examples/experimental/skip_test/branching_runs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"from weave.legacy.ops_domain import RunSegment\n",
"from weave.legacy import storage\n",
"from weave import publish, type_of\n",
"from weave.weave_types import List\n",
"from weave.legacy.weave_types import List\n",
"import typing\n",
"import time\n",
"import sys\n",
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ disallow_untyped_calls = False
disallow_untyped_defs = False
disallow_untyped_calls = False

[mypy-weave.weave_types]
[mypy-weave.legacy.weave_types]
disallow_untyped_defs = False
disallow_untyped_calls = False

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

_loading_builtins_token = _context_state.set_loading_built_ins()

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

from .legacy.api import *
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 @@ -4,7 +4,7 @@
from weave.legacy.language_features.tagging import tag_store, tagged_value_type

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


def typeddict_pick_output_type(input_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 @@ -21,7 +21,7 @@
from ..trace import weave_client as _weave_client

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

# needed to enable automatic numpy serialization
from . import types_numpy as _types_numpy
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 @@ -12,7 +12,7 @@
py_type = type

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


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

from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy.arrow import convert
from weave.legacy.arrow.arrow import offsets_starting_at_zero
from weave.legacy.language_features.tagging import (
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 @@ -13,7 +13,7 @@
from pyarrow import compute as pc

from weave.legacy import errors
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy.arrow.list_ import (
ArrowWeaveList,
ArrowWeaveListGeneric,
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 @@ -4,7 +4,7 @@
import pyarrow as pa

from weave.legacy import errors
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import artifact_base, box
from weave.legacy.arrow import arrow_tags, convert
from weave.legacy.arrow.arrow import ArrowWeaveListType, arrow_as_array
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/arrow/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from weave.legacy import api as api
from weave import weave_internal
from weave import weave_types as types
from weave.legacy import weave_types as types
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 @@ -13,7 +13,7 @@
from weave import (
weave_internal,
)
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import (
errors,
_dict_utils,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/artifact_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import typing

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


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 @@ -7,7 +7,7 @@
import typing

from weave.legacy import errors
from weave import weave_types as types
from weave.legacy 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
from weave.trace import ref_util
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/artifact_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from datetime import datetime

from weave.legacy import filesystem
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import (
artifact_fs,
artifact_wandb,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/artifact_mem.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing

from . import artifact_base
from weave import weave_types as types
from weave.legacy import weave_types as types
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 @@ -13,7 +13,7 @@
from wandb.apis.public import api as wb_public
from wandb.sdk.lib.hashutil import b64_to_hex_id, hex_to_b64_id

from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import (
filesystem,
urls,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from weave import weave_types
from weave.legacy import weave_types
from weave.legacy import storage


Expand Down
4 changes: 2 additions & 2 deletions weave/legacy/codify.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import black

from weave import weave_types
from weave.legacy import weave_types
from weave.legacy import storage, graph, registry_mem

from . import codifiable_value_mixin
Expand Down Expand Up @@ -128,7 +128,7 @@ def _try_otc_using_dataclasses(obj: typing.Any) -> typing.Optional[str]:
if class_type.__module__.startswith("weave.decorator_type") and issubclass(
class_type, weave_types.Type
):
qualified_classpath = "weave.weave_types"
qualified_classpath = "weave.legacy.weave_types"
qualified_classname = f"type_name_to_type('{class_type.name}')"
else:
qualified_classpath = _module_name_corrections(class_type.__module__)
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from weave import (
weave_internal,
)
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import (
errors,
engine_trace,
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 @@ -3,7 +3,7 @@
import graphql

from weave.legacy import errors
from weave import weave_types as types
from weave.legacy 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/debug_types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import textwrap

from weave.legacy.language_features.tagging import tagged_value_type
from weave.weave_types import *
from weave.legacy.weave_types import *


def short_type(type: Type) -> str:
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/decorator_arrow_op.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing

from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import op_def
from weave.legacy.arrow.arrow import ArrowWeaveListType
from weave.legacy.language_features.tagging import tagged_value_type
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/decorator_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import typing

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

# Contrary to the way it is read, the weave.class() decorator runs AFTER the
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/decorator_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from typing_extensions import ParamSpec

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

if typing.TYPE_CHECKING:
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 @@ -3,7 +3,7 @@
import typing

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

_py_type = type
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 @@ -10,7 +10,7 @@
storage,
weave_internal,
)
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import (
errors,
parallelism,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dataclasses import dataclass

from weave.legacy import util
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import graph, memo, op_args, op_def, pyfunc_type_util, registry_mem, errors
from weave.legacy.language_features.tagging.is_tag_getter import is_tag_getter
from weave.legacy.language_features.tagging.tagged_value_type import TaggedValueType
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/eager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from weave.legacy import context_state, graph

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

WeaveIterObjectType = typing.TypeVar("WeaveIterObjectType")

Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/ecosystem/langchain/lc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from weave.legacy.artifact_fs import FilesystemArtifact
from weave.legacy.ecosystem.langchain import util
from weave.legacy.ops_domain import trace_tree
from weave.weave_types import Type
from weave.legacy.weave_types import Type


class WeaveTracer(BaseTracer):
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import typing
from collections.abc import Mapping

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

# Configuration
# Libraries
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/execute_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from weave import (
weave_internal,
)
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import (
errors,
engine_trace,
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/file_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import dataclasses
import typing

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

TRACE_EXT = "trace.json"

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

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

from . import file_base, file_util

Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/gql_op_plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing
from dataclasses import dataclass

from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import input_provider, op_args, op_def

# A GQLOutputTypeFn is a function that is called during the refinement phase of the compile pass
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/gql_to_weave.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)

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


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

from weave import weave_types
from weave.legacy import weave_types
from weave.legacy import uris, errors, storage

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

from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import forward_graph, graph


Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/graph_mapper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from weave.legacy import ref_base
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import graph, mappers, node_ref
from weave.legacy import mappers_python_def as mappers_python

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

from weave.legacy import errors, graph

from .. import weave_types
from weave.legacy import weave_types


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

import typing

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


Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/language_features/tagging/is_tag_getter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing

from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import op_args
from weave.legacy.language_features.tagging import tagged_value_type

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing

from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import context_state as _context_state
from weave.legacy import decorator_op
from weave.legacy.language_features.tagging import tag_store, tagged_value_type
Expand Down
2 changes: 1 addition & 1 deletion weave/legacy/language_features/tagging/opdef_util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing

from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy.language_features.tagging import tagged_value_type

if typing.TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import typing

from weave.legacy import registry_mem
from weave import weave_types as types
from weave.legacy import weave_types as types
from weave.legacy import graph
from weave.legacy.language_features.tagging.opdef_util import (
should_flow_tags,
Expand Down
Loading

0 comments on commit 2bd395f

Please sign in to comment.