Skip to content

Commit

Permalink
fix: bug in metric call
Browse files Browse the repository at this point in the history
Signed-off-by: Kushal Batra <[email protected]>
  • Loading branch information
s0nicboOm committed Jun 28, 2024
1 parent 4b38829 commit 324c346
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions numalogic/udfs/_metrics_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_metrics(self) -> dict[str, metrics_t]:

# helper functions
def _increment_counter(
counter: str, labels: Optional[dict], amount: int = 1, is_enabled=True
counter: str, labels: Optional[dict], amount: int = 1, is_enabled=False
) -> None:
"""
Utility function is used to increment the counter.
Expand All @@ -69,7 +69,7 @@ def _increment_counter(
LOGGER.error(f"Metric {counter} not found in metrics")


def _add_info(info: str, labels: Optional[dict], data: dict, is_enabled=True) -> None:
def _add_info(info: str, labels: Optional[dict], data: dict, is_enabled=False) -> None:
"""
Utility function is used to add the info.
Expand All @@ -89,7 +89,7 @@ def _add_info(info: str, labels: Optional[dict], data: dict, is_enabled=True) ->
LOGGER.error(f"Metric {info} not found in metrics")


def _add_summary(summary: str, labels: Optional[dict], data: float, is_enabled=True) -> None:
def _add_summary(summary: str, labels: Optional[dict], data: float, is_enabled=False) -> None:
"""
Utility function is used to add the summary.
Expand All @@ -109,7 +109,7 @@ def _add_summary(summary: str, labels: Optional[dict], data: float, is_enabled=T
LOGGER.error(f"Metric {summary} not found in metrics")


def _set_gauge(gauge: str, labels: Optional[dict], data: float, is_enabled=True) -> None:
def _set_gauge(gauge: str, labels: Optional[dict], data: float, is_enabled=False) -> None:
"""
Utility function is used to add the info.
Args:
Expand Down
1 change: 1 addition & 0 deletions numalogic/udfs/trainer/_druid.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def fetch_data(self, payload: TrainerPayload) -> Optional[pd.DataFrame]:
"DATAFRAME_SHAPE_SUMMARY",
labels=_metric_label_values,
data=_df.shape[0],
is_enabled=METRICS_ENABLED,
)

return _df
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "numalogic"
version = "0.12.1"
version = "0.12.2"
description = "Collection of operational Machine Learning models and tools."
authors = ["Numalogic Developers"]
packages = [{ include = "numalogic" }]
Expand Down

0 comments on commit 324c346

Please sign in to comment.