diff --git a/tcex/api/tc/ti_transform/ti_transform.py b/tcex/api/tc/ti_transform/ti_transform.py index f5c4f7f09..76161cff3 100644 --- a/tcex/api/tc/ti_transform/ti_transform.py +++ b/tcex/api/tc/ti_transform/ti_transform.py @@ -17,7 +17,8 @@ def process(self): for ti_dict in self.ti_dicts: self.transformed_collection.append(TiTransform(ti_dict, self.transforms)) - def batch(self, raise_exceptions=True) -> dict: + @property + def batch(self) -> dict: """Return the data in batch format.""" self.process() @@ -35,7 +36,7 @@ def batch(self, raise_exceptions=True) -> dict: data = t.batch except Exception: self.log.exception('feature=ti-transforms, event=transform-error') - if raise_exceptions: + if self.raise_exceptions: raise continue diff --git a/tcex/api/tc/ti_transform/transform_abc.py b/tcex/api/tc/ti_transform/transform_abc.py index 1ec95e0ca..9d0b61262 100644 --- a/tcex/api/tc/ti_transform/transform_abc.py +++ b/tcex/api/tc/ti_transform/transform_abc.py @@ -75,6 +75,7 @@ def __init__( self, ti_dicts: list[dict], transforms: list[GroupTransformModel | IndicatorTransformModel], + raise_exceptions: bool = False, ): """Initialize instance properties.""" self.ti_dicts = ti_dicts @@ -82,6 +83,7 @@ def __init__( # properties self.log = _logger + self.raise_exceptions = raise_exceptions self.transformed_collection: list[TransformABC] = [] # validate transforms