From f9b17cf81e02d03b06e03ffcacde1e6e9dab3c36 Mon Sep 17 00:00:00 2001 From: Andrew Truong Date: Thu, 22 Aug 2024 00:41:07 -0400 Subject: [PATCH] weavejs_fixes --- weave/legacy/op_def.py | 2 +- weave/{ => legacy}/weavejs_fixes.py | 2 +- weave/show.py | 2 +- weave/tests/legacy/test_js_compat.py | 3 +-- weave/tests/legacy/test_storage.py | 2 +- weave/tests/legacy/test_weavejs_fixes.py | 4 ++-- weave/weave_server.py | 3 +-- 7 files changed, 8 insertions(+), 10 deletions(-) rename weave/{ => legacy}/weavejs_fixes.py (99%) diff --git a/weave/legacy/op_def.py b/weave/legacy/op_def.py index 0dff7ace695..25438b8b24c 100644 --- a/weave/legacy/op_def.py +++ b/weave/legacy/op_def.py @@ -31,7 +31,7 @@ tagged_value_type, ) from weave.legacy.run import Run -from weave.weavejs_fixes import fixup_node +from weave.legacy.weavejs_fixes import fixup_node if typing.TYPE_CHECKING: from weave.trace import weave_client diff --git a/weave/weavejs_fixes.py b/weave/legacy/weavejs_fixes.py similarity index 99% rename from weave/weavejs_fixes.py rename to weave/legacy/weavejs_fixes.py index cc78520c0a0..6a07b7a93c9 100644 --- a/weave/weavejs_fixes.py +++ b/weave/legacy/weavejs_fixes.py @@ -10,7 +10,7 @@ from weave.legacy import graph -from . import weave_types +from .. import weave_types def _convert_specific_opname_to_generic_opname( diff --git a/weave/show.py b/weave/show.py index cd55e63f087..5027cb8fa79 100644 --- a/weave/show.py +++ b/weave/show.py @@ -14,9 +14,9 @@ storage, usage_analytics, util, - weavejs_fixes, ) from . import weave_types as types +from .legacy import weavejs_fixes def make_varname_for_type(t: types.Type): diff --git a/weave/tests/legacy/test_js_compat.py b/weave/tests/legacy/test_js_compat.py index 190a7b747fb..87a7adb648c 100644 --- a/weave/tests/legacy/test_js_compat.py +++ b/weave/tests/legacy/test_js_compat.py @@ -8,8 +8,7 @@ # weave Python code that I haven't documented here. from weave import weave_types as types -from weave import weavejs_fixes -from weave.legacy import partial_object +from weave.legacy import partial_object, weavejs_fixes from weave.legacy.ops_domain import wb_domain_types diff --git a/weave/tests/legacy/test_storage.py b/weave/tests/legacy/test_storage.py index f1e7cb3f9e6..3821f662a26 100644 --- a/weave/tests/legacy/test_storage.py +++ b/weave/tests/legacy/test_storage.py @@ -13,8 +13,8 @@ from ... import api as weave from ... import storage from ... import weave_types as types +from ...legacy.weavejs_fixes import recursively_unwrap_unions from ...weave_internal import make_const_node -from ...weavejs_fixes import recursively_unwrap_unions from . import test_helpers diff --git a/weave/tests/legacy/test_weavejs_fixes.py b/weave/tests/legacy/test_weavejs_fixes.py index 32cff043df9..e654405a6bd 100644 --- a/weave/tests/legacy/test_weavejs_fixes.py +++ b/weave/tests/legacy/test_weavejs_fixes.py @@ -2,9 +2,9 @@ import pytest -from weave.legacy import context_state, mappers_python, ops +from weave.legacy import context_state, mappers_python, ops, weavejs_fixes -from ... import api, weave_internal, weavejs_fixes +from ... import api, weave_internal from ... import weave_types as types diff --git a/weave/weave_server.py b/weave/weave_server.py index 8d6134a128d..db96977c0a4 100644 --- a/weave/weave_server.py +++ b/weave/weave_server.py @@ -35,9 +35,8 @@ server, storage, util, - weavejs_fixes, ) -from weave.legacy import context_state, graph, value_or_error, wandb_api +from weave.legacy import context_state, graph, value_or_error, wandb_api, weavejs_fixes from weave.legacy.language_features.tagging import tag_store from weave.server_error_handling import client_safe_http_exceptions_as_werkzeug