♻️ (base.py): Refactor add_trace and end_trace methods to use Union type for optional arguments to improve code readability and type safety
This commit is contained in:
parent
df2015160e
commit
d37ae29a3b
1 changed files with 5 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
from uuid import UUID
|
||||||
|
|
||||||
|
|
||||||
class BaseTracer(ABC):
|
class BaseTracer(ABC):
|
||||||
|
|
@ -12,11 +13,13 @@ class BaseTracer(ABC):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add_trace(self, trace_name: str, trace_type: str, inputs: Dict[str, Any], metadata: Dict[str, Any] = None):
|
def add_trace(
|
||||||
|
self, trace_name: str, trace_type: str, inputs: Dict[str, Any], metadata: Dict[str, Any] | None = None
|
||||||
|
):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def end_trace(self, trace_name: str, outputs: Dict[str, Any] = None, error: str = None):
|
def end_trace(self, trace_name: str, outputs: Dict[str, Any] | None = None, error: str | None = None):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue