Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bug in metric call #398

Merged
merged 1 commit into from
Jun 28, 2024
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
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
Loading