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
3 changes: 1 addition & 2 deletions src/splunk_ao/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from splunk_ao.protect import ainvoke_protect, invoke_protect
from splunk_ao.provider import AnthropicProvider, AzureProvider, BedrockProvider, OpenAIProvider, Provider
from splunk_ao.schema.message import Message
from splunk_ao.schema.metrics import GalileoScorers, SplunkAOMetrics
from splunk_ao.schema.metrics import SplunkAOMetrics
from splunk_ao.shared.base import SyncState
from splunk_ao.shared.exceptions import (
APIError,
Expand Down Expand Up @@ -107,7 +107,6 @@
"ExecutionStatus",
"Experiment",
"ForbiddenError",
"GalileoScorers",
"Integration",
"LlmMetric",
"LlmSpan",
Expand Down
53 changes: 1 addition & 52 deletions src/splunk_ao/schema/metrics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import warnings
from collections.abc import Callable, Iterator
from collections.abc import Callable
from enum import Enum
from typing import Any, Generic, TypeVar

Expand All @@ -10,7 +9,6 @@
from galileo_core.schemas.logging.step import STEP_TYPES_WITH_CHILD_SPANS, StepType
from galileo_core.schemas.logging.trace import Trace
from galileo_core.schemas.shared.metric import MetricValueType
from galileo_core.schemas.shared.scorers.scorer_name import ScorerName


class SplunkAOMetrics(str, Enum):
Expand Down Expand Up @@ -71,55 +69,6 @@ class SplunkAOMetrics(str, Enum):
user_intent_change = "User Intent Change"


class _SplunkAOScorersProxyMeta(type):
"""Metaclass that makes GalileoScorers a deprecated proxy for ScorerName."""

_DEPRECATION_MSG = (
"GalileoScorers is deprecated and will be removed in a future release. Use galileo_core ScorerName instead."
)

def __getattribute__(cls, name: str) -> Any:
if name.startswith("_") or name in ("__class__", "__mro__", "__dict__", "__bases__"):
return type.__getattribute__(cls, name)
warnings.warn(cls._DEPRECATION_MSG, DeprecationWarning, stacklevel=2)
return getattr(ScorerName, name)

def __getitem__(cls, name: str) -> ScorerName:
warnings.warn(cls._DEPRECATION_MSG, DeprecationWarning, stacklevel=2)
return ScorerName[name]

def __instancecheck__(cls, instance: Any) -> bool:
return isinstance(instance, ScorerName)

def __subclasscheck__(cls, subclass: type) -> bool:
return issubclass(subclass, ScorerName)

def __iter__(cls) -> Iterator[ScorerName]:
warnings.warn(cls._DEPRECATION_MSG, DeprecationWarning, stacklevel=2)
return iter(ScorerName)

def __contains__(cls, item: Any) -> bool:
warnings.warn(cls._DEPRECATION_MSG, DeprecationWarning, stacklevel=2)
return item in ScorerName

def __dir__(cls) -> list[str]:
return [m.name for m in ScorerName]

def __repr__(cls) -> str:
return "<deprecated GalileoScorers proxy - use ScorerName>"


class _SplunkAOScorersProxy(metaclass=_SplunkAOScorersProxyMeta):
"""Deprecated proxy that forwards to ScorerName."""

def __new__(cls, value: Any) -> ScorerName:
warnings.warn(_SplunkAOScorersProxyMeta._DEPRECATION_MSG, DeprecationWarning, stacklevel=2)
return ScorerName(value)


GalileoScorers = _SplunkAOScorersProxy


MetricType = TypeVar("MetricType", bound=MetricValueType)


Expand Down
78 changes: 0 additions & 78 deletions tests/test_deprecations.py

This file was deleted.

Loading