arthur-common 2.1.47__tar.gz → 2.1.49__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of arthur-common might be problematic. Click here for more details.

Files changed (39) hide show
  1. {arthur_common-2.1.47 → arthur_common-2.1.49}/PKG-INFO +1 -1
  2. {arthur_common-2.1.47 → arthur_common-2.1.49}/pyproject.toml +1 -1
  3. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/confusion_matrix.py +10 -6
  4. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/models/connectors.py +2 -0
  5. {arthur_common-2.1.47 → arthur_common-2.1.49}/README.md +0 -0
  6. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/__init__.py +0 -0
  7. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/__init__.py +0 -0
  8. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/aggregator.py +0 -0
  9. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/README.md +0 -0
  10. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/__init__.py +0 -0
  11. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/categorical_count.py +0 -0
  12. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/inference_count.py +0 -0
  13. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/inference_count_by_class.py +0 -0
  14. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/inference_null_count.py +0 -0
  15. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/mean_absolute_error.py +0 -0
  16. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/mean_squared_error.py +0 -0
  17. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/multiclass_confusion_matrix.py +0 -0
  18. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/multiclass_inference_count_by_class.py +0 -0
  19. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/numeric_stats.py +0 -0
  20. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/numeric_sum.py +0 -0
  21. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/py.typed +0 -0
  22. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/functions/shield_aggregations.py +0 -0
  23. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/aggregations/py.typed +0 -0
  24. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/models/__init__.py +0 -0
  25. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/models/datasets.py +0 -0
  26. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/models/metrics.py +0 -0
  27. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/models/py.typed +0 -0
  28. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/models/schema_definitions.py +0 -0
  29. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/models/shield.py +0 -0
  30. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/models/task_job_specs.py +0 -0
  31. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/py.typed +0 -0
  32. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/tools/__init__.py +0 -0
  33. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/tools/aggregation_analyzer.py +0 -0
  34. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/tools/aggregation_loader.py +0 -0
  35. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/tools/duckdb_data_loader.py +0 -0
  36. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/tools/functions.py +0 -0
  37. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/tools/py.typed +0 -0
  38. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/tools/schema_inferer.py +0 -0
  39. {arthur_common-2.1.47 → arthur_common-2.1.49}/src/arthur_common/tools/time_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arthur-common
3
- Version: 2.1.47
3
+ Version: 2.1.49
4
4
  Summary: Utility code common to Arthur platform components.
5
5
  License: MIT
6
6
  Author: Arthur
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "arthur-common"
3
- version = "2.1.47"
3
+ version = "2.1.49"
4
4
  description = "Utility code common to Arthur platform components."
5
5
  authors = ["Arthur <engineering@arthur.ai>"]
6
6
  license = "MIT"
@@ -13,7 +13,7 @@ from arthur_common.models.schema_definitions import (
13
13
  ScalarType,
14
14
  ScopeSchemaTag,
15
15
  )
16
- from arthur_common.tools.duckdb_data_loader import escape_identifier
16
+ from arthur_common.tools.duckdb_data_loader import escape_identifier, escape_str_literal
17
17
  from duckdb import DuckDBPyConnection
18
18
 
19
19
 
@@ -57,7 +57,8 @@ class ConfusionMatrixAggregationFunction(NumericAggregationFunction):
57
57
  SUM(CASE WHEN prediction = actual_value AND actual_value = 1 THEN 1 ELSE 0 END) AS true_positive_count,
58
58
  SUM(CASE WHEN prediction != actual_value AND actual_value = 0 THEN 1 ELSE 0 END) AS false_positive_count,
59
59
  SUM(CASE WHEN prediction != actual_value AND actual_value = 1 THEN 1 ELSE 0 END) AS false_negative_count,
60
- SUM(CASE WHEN prediction = actual_value AND actual_value = 0 THEN 1 ELSE 0 END) AS true_negative_count
60
+ SUM(CASE WHEN prediction = actual_value AND actual_value = 0 THEN 1 ELSE 0 END) AS true_negative_count,
61
+ {escaped_prediction_col_name} as prediction_column_name
61
62
  FROM normalized_data
62
63
  GROUP BY ts
63
64
  ORDER BY ts
@@ -65,6 +66,7 @@ class ConfusionMatrixAggregationFunction(NumericAggregationFunction):
65
66
  segmentation_cols = [] if not segmentation_cols else segmentation_cols
66
67
  escaped_timestamp_col = escape_identifier(timestamp_col)
67
68
  escaped_prediction_col = escape_identifier(prediction_col)
69
+ escaped_prediction_col_name = escape_str_literal(prediction_col)
68
70
  escaped_gt_values_col = escape_identifier(gt_values_col)
69
71
  # build query components with segmentation columns
70
72
  escaped_segmentation_cols = [
@@ -81,8 +83,10 @@ class ConfusionMatrixAggregationFunction(NumericAggregationFunction):
81
83
  "SUM(CASE WHEN prediction != actual_value AND actual_value = 0 THEN 1 ELSE 0 END) AS false_positive_count",
82
84
  "SUM(CASE WHEN prediction != actual_value AND actual_value = 1 THEN 1 ELSE 0 END) AS false_negative_count",
83
85
  "SUM(CASE WHEN prediction = actual_value AND actual_value = 0 THEN 1 ELSE 0 END) AS true_negative_count",
86
+ f"{escaped_prediction_col_name} as prediction_column_name",
84
87
  ] + escaped_segmentation_cols
85
88
  second_subquery_group_by_cols = ["ts"] + escaped_segmentation_cols
89
+ extra_dims = ["prediction_column_name"]
86
90
 
87
91
  # build query
88
92
  confusion_matrix_query = f"""
@@ -102,25 +106,25 @@ class ConfusionMatrixAggregationFunction(NumericAggregationFunction):
102
106
  tp = self.group_query_results_to_numeric_metrics(
103
107
  results,
104
108
  "true_positive_count",
105
- dim_columns=segmentation_cols,
109
+ dim_columns=segmentation_cols + extra_dims,
106
110
  timestamp_col="ts",
107
111
  )
108
112
  fp = self.group_query_results_to_numeric_metrics(
109
113
  results,
110
114
  "false_positive_count",
111
- dim_columns=segmentation_cols,
115
+ dim_columns=segmentation_cols + extra_dims,
112
116
  timestamp_col="ts",
113
117
  )
114
118
  fn = self.group_query_results_to_numeric_metrics(
115
119
  results,
116
120
  "false_negative_count",
117
- dim_columns=segmentation_cols,
121
+ dim_columns=segmentation_cols + extra_dims,
118
122
  timestamp_col="ts",
119
123
  )
120
124
  tn = self.group_query_results_to_numeric_metrics(
121
125
  results,
122
126
  "true_negative_count",
123
- dim_columns=segmentation_cols,
127
+ dim_columns=segmentation_cols + extra_dims,
124
128
  timestamp_col="ts",
125
129
  )
126
130
  tp_metric = self.series_to_metric("confusion_matrix_true_positive_count", tp)
@@ -35,6 +35,8 @@ MSSQL_CONNECTOR_DATABASE_FIELD = "database"
35
35
  MSSQL_CONNECTOR_USERNAME_FIELD = "username"
36
36
  MSSQL_CONNECTOR_PASSWORD_FIELD = "password"
37
37
  MSSQL_CONNECTOR_DRIVER_FIELD = "driver"
38
+ MSSQL_CONNECTOR_TABLE_NAME_FIELD = "table_name"
39
+
38
40
 
39
41
  # dataset (connector type dependent) constants
40
42
  SHIELD_DATASET_TASK_ID_FIELD = "task_id"
File without changes