diff --git a/numalogic/udfs/__main__.py b/numalogic/udfs/__main__.py index d787df95..5c63936d 100644 --- a/numalogic/udfs/__main__.py +++ b/numalogic/udfs/__main__.py @@ -17,8 +17,6 @@ redis_client = get_redis_client_from_conf(pipeline_conf.redis_conf) -for key in redis_client.scan_iter("*"): - redis_client.delete(key) if __name__ == "__main__": set_logger() step = sys.argv[1] diff --git a/numalogic/udfs/entities.py b/numalogic/udfs/entities.py index 4044e6e5..ba4f75bd 100644 --- a/numalogic/udfs/entities.py +++ b/numalogic/udfs/entities.py @@ -81,9 +81,6 @@ def get_data(self, original=False) -> npt.NDArray[float]: def get_metadata(self, key: str) -> dict[str, Any]: return copy(self.metadata[key]) - def add_metadata(self, data: dict[str, Any]): - self.metadata.update(data) - def __str__(self) -> str: return ( f'"StreamPayload(header={self.header}, status={self.status}, ' diff --git a/numalogic/udfs/tools.py b/numalogic/udfs/tools.py index 5c3ed61a..b2dee9de 100644 --- a/numalogic/udfs/tools.py +++ b/numalogic/udfs/tools.py @@ -131,7 +131,11 @@ def _load_artifact( skeys, dkeys, ) - if artifact.metadata and "artifact_versions" in artifact.metadata: + if ( + artifact.metadata + and "artifact_versions" in artifact.metadata + and "artifact_versions" not in payload.metadata + ): payload = replace( payload, metadata={ diff --git a/tests/udfs/test_inference.py b/tests/udfs/test_inference.py index 5536cfec..ad07e3d4 100644 --- a/tests/udfs/test_inference.py +++ b/tests/udfs/test_inference.py @@ -84,7 +84,6 @@ class TestInferenceUDF(unittest.TestCase): def setUp(self) -> None: self.udf = InferenceUDF(REDIS_CLIENT) self.udf.register_conf("conf1", StreamConf(config_id="conf1")) - print(self.udf.get_conf("conf1")) @patch.object( RedisRegistry, diff --git a/tests/udfs/test_postprocess.py b/tests/udfs/test_postprocess.py index 20aa361f..4df25ca7 100644 --- a/tests/udfs/test_postprocess.py +++ b/tests/udfs/test_postprocess.py @@ -113,10 +113,8 @@ def test_postprocess_infer_model_stale(self): data = deepcopy(DATA) data["status"] = Status.ARTIFACT_STALE data["header"] = Header.MODEL_INFERENCE - print( - self.registry.save( - KEYS, ["StdDevThreshold"], StdDevThreshold().fit(np.asarray([[0, 1], [1, 2]])) - ) + self.registry.save( + KEYS, ["StdDevThreshold"], StdDevThreshold().fit(np.asarray([[0, 1], [1, 2]])) ) msg = self.udf(KEYS, Datum(keys=KEYS, value=orjson.dumps(data), **DATUM_KW)) self.assertEqual(2, len(msg))