icsDataValidation 1.0.271__py3-none-any.whl → 1.0.273__py3-none-any.whl
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.
- icsDataValidation/core/object_comparison.py +1 -1
- icsDataValidation/output_parameters/result_params.py +0 -1
- icsDataValidation/services/comparison_service.py +3 -18
- icsDataValidation/services/result_service.py +15 -5
- {icsDataValidation-1.0.271.dist-info → icsDataValidation-1.0.273.dist-info}/METADATA +1 -1
- {icsDataValidation-1.0.271.dist-info → icsDataValidation-1.0.273.dist-info}/RECORD +8 -8
- {icsDataValidation-1.0.271.dist-info → icsDataValidation-1.0.273.dist-info}/WHEEL +0 -0
- {icsDataValidation-1.0.271.dist-info → icsDataValidation-1.0.273.dist-info}/top_level.txt +0 -0
|
@@ -122,7 +122,7 @@ def compare_objects(testing_tool_params: TestingToolParams, objects_to_compare:
|
|
|
122
122
|
|
|
123
123
|
for column in comparison_service.result_params.all_columns_trgt_src:
|
|
124
124
|
|
|
125
|
-
column_level_comparison_result=ResultService.prepare_column_level_result(column, exclude_columns, comparison_service.result_params
|
|
125
|
+
column_level_comparison_result=ResultService.prepare_column_level_result(column, exclude_columns, comparison_service.result_params)
|
|
126
126
|
|
|
127
127
|
if column_level_comparison_result["COUNT_NULLS_EQUAL"] is False:
|
|
128
128
|
comparison_service.result_params.all_count_nulls_equal = False
|
|
@@ -4,6 +4,7 @@ import datetime
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
|
|
6
6
|
from pandas._testing import assert_frame_equal
|
|
7
|
+
from decimal import Decimal
|
|
7
8
|
|
|
8
9
|
from icsDataValidation.utils.logger_util import configure_dev_ops_logger
|
|
9
10
|
from icsDataValidation.utils.pandas_util import get_diff_dataframes, get_diff_dict_from_diff_dataframes
|
|
@@ -166,8 +167,8 @@ class ComparisonService(TestingToolParams):
|
|
|
166
167
|
|
|
167
168
|
if self.result_params.src_row_count != 0 and self.result_params.trgt_row_count != 0:
|
|
168
169
|
aggregation_differences_trgt_minus_src_not_boolean = {
|
|
169
|
-
k: round(
|
|
170
|
-
-
|
|
170
|
+
k: round(Decimal(trgt_columns_aggregate[k][1])
|
|
171
|
+
- Decimal(src_columns_aggregate[k][1]), self.numeric_scale)
|
|
171
172
|
for k in src_columns_aggregate.keys()
|
|
172
173
|
if k in trgt_columns_aggregate
|
|
173
174
|
and str(src_columns_aggregate[k][1]) != str(trgt_columns_aggregate[k][1])
|
|
@@ -240,20 +241,6 @@ class ComparisonService(TestingToolParams):
|
|
|
240
241
|
if aggregation_diff and not aggregation_diff == 0.0:
|
|
241
242
|
aggregations_equal = False
|
|
242
243
|
break
|
|
243
|
-
aggregations_equal_tolerated = aggregations_equal
|
|
244
|
-
|
|
245
|
-
if 'DATATYPE_TOLERACE' not in self.migration_config['MAPPING'].keys():
|
|
246
|
-
aggregations_equal_tolerated = None
|
|
247
|
-
else:
|
|
248
|
-
numeric_cols = {i['COLUMN_NAME']:i['DATA_TYPE'] for i in src_column_datatypes if i['DATA_TYPE'] in self.migration_config['MAPPING']['DATATYPE_TOLERACE'].keys()}
|
|
249
|
-
for col in numeric_cols.keys():
|
|
250
|
-
if (
|
|
251
|
-
col in aggregation_differences_trgt_minus_src.keys()
|
|
252
|
-
and src_columns_aggregate[col][0]=='SUM'
|
|
253
|
-
and abs(aggregation_differences_trgt_minus_src[col]) <= self.migration_config["MAPPING"]["DATATYPE_TOLERACE"][numeric_cols[col]]
|
|
254
|
-
):
|
|
255
|
-
aggregations_equal_tolerated = True
|
|
256
|
-
|
|
257
244
|
|
|
258
245
|
# save results
|
|
259
246
|
self.result_params.src_column_datatypes = src_column_datatypes
|
|
@@ -266,8 +253,6 @@ class ComparisonService(TestingToolParams):
|
|
|
266
253
|
self.result_params.src_error_dict = src_error_dict
|
|
267
254
|
self.result_params.trgt_error_dict = trgt_error_dict
|
|
268
255
|
self.result_params.aggregations_equal = aggregations_equal
|
|
269
|
-
self.result_params.aggregations_equal_tolerated = aggregations_equal_tolerated
|
|
270
|
-
|
|
271
256
|
|
|
272
257
|
|
|
273
258
|
def group_by_comparison(self):
|
|
@@ -4,6 +4,7 @@ import subprocess
|
|
|
4
4
|
import json
|
|
5
5
|
|
|
6
6
|
from azure.storage.blob import BlobServiceClient
|
|
7
|
+
from decimal import Decimal
|
|
7
8
|
|
|
8
9
|
from icsDataValidation.services.system_service import SystemService
|
|
9
10
|
from icsDataValidation.utils.logger_util import configure_dev_ops_logger
|
|
@@ -107,8 +108,7 @@ class ResultService(TestingToolParams):
|
|
|
107
108
|
def prepare_column_level_result(
|
|
108
109
|
column: str,
|
|
109
110
|
exclude_columns: list,
|
|
110
|
-
result_params: ResultParams
|
|
111
|
-
testing_tool_params: TestingToolParams
|
|
111
|
+
result_params: ResultParams
|
|
112
112
|
) -> dict:
|
|
113
113
|
"""
|
|
114
114
|
Get column level result dictionary from the result parameters.
|
|
@@ -187,7 +187,7 @@ class ResultService(TestingToolParams):
|
|
|
187
187
|
if (
|
|
188
188
|
src_datatype in TestingToolParams.migration_config['MAPPING']['DATATYPE_TOLERACE'].keys()
|
|
189
189
|
and aggregation_type == 'SUM'
|
|
190
|
-
and abs(
|
|
190
|
+
and abs(Decimal(aggregation_difference_trgt_minus_src)) <= Decimal(TestingToolParams.migration_config['MAPPING']['DATATYPE_TOLERACE'][src_datatype])
|
|
191
191
|
):
|
|
192
192
|
aggregation_tolerated = True
|
|
193
193
|
else :
|
|
@@ -224,7 +224,7 @@ class ResultService(TestingToolParams):
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
return column_comparison_result
|
|
227
|
-
|
|
227
|
+
|
|
228
228
|
@staticmethod
|
|
229
229
|
def prepare_object_level_result(
|
|
230
230
|
src_object: DatabaseObject,
|
|
@@ -238,6 +238,16 @@ class ResultService(TestingToolParams):
|
|
|
238
238
|
"""
|
|
239
239
|
Get object level result dictionary from the result parameters and from the column level result.
|
|
240
240
|
"""
|
|
241
|
+
|
|
242
|
+
if 'DATATYPE_TOLERACE' not in TestingToolParams.migration_config['MAPPING']:
|
|
243
|
+
aggregations_equal_tolerated = None
|
|
244
|
+
elif result_params.aggregations_equal:
|
|
245
|
+
aggregations_equal_tolerated = True
|
|
246
|
+
elif all([column['AGGREGATION_EQUAL_TOLERATED'] for column in column_level_comparison_result]):
|
|
247
|
+
aggregations_equal_tolerated = True
|
|
248
|
+
else:
|
|
249
|
+
aggregations_equal_tolerated = False
|
|
250
|
+
|
|
241
251
|
object_level_comparison_result = {
|
|
242
252
|
"SRC_DATABASE_NAME": src_object.database,
|
|
243
253
|
"SRC_SCHEMA_NAME": src_object.schema,
|
|
@@ -260,7 +270,7 @@ class ResultService(TestingToolParams):
|
|
|
260
270
|
"TRGT_ROW_COUNT": result_params.trgt_row_count,
|
|
261
271
|
"ALL_COUNT_NULLS_EQUAL": result_params.all_count_nulls_equal,
|
|
262
272
|
"AGGREGATIONS_EQUAL": result_params.aggregations_equal,
|
|
263
|
-
"AGGREGATIONS_EQUAL_TOLERATED":
|
|
273
|
+
"AGGREGATIONS_EQUAL_TOLERATED": aggregations_equal_tolerated,
|
|
264
274
|
"SRC_ERROR": result_params.src_error_dict,
|
|
265
275
|
"TRGT_ERROR": result_params.trgt_error_dict,
|
|
266
276
|
"GROUP_BY_COLUMNS": result_params.object_group_by_columns,
|
|
@@ -11,15 +11,15 @@ icsDataValidation/connection_setups/snowflake_connection_setup.py,sha256=JDTdIM0
|
|
|
11
11
|
icsDataValidation/connection_setups/teradata_connection_setup.py,sha256=fIpuxz-FTqFK2vSMSuokqU9sdJkaJ4UP5piY_zIbj5k,624
|
|
12
12
|
icsDataValidation/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
icsDataValidation/core/database_objects.py,sha256=2oaDaVQajSYI_HJjJy1pmc6FsoK_wMfwgu6ZgEcFvow,523
|
|
14
|
-
icsDataValidation/core/object_comparison.py,sha256=
|
|
14
|
+
icsDataValidation/core/object_comparison.py,sha256=OEz5m1pp_PbIWyM5998iB5obFKYdJEqDo9Z0Hpj7o4A,14988
|
|
15
15
|
icsDataValidation/input_parameters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
icsDataValidation/input_parameters/testing_tool_params.py,sha256=6LkqEaH3vaeCn6d1b3jYIwlXAXIRclxLzcXdsmlkc9M,6731
|
|
17
17
|
icsDataValidation/output_parameters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
icsDataValidation/output_parameters/result_params.py,sha256=
|
|
18
|
+
icsDataValidation/output_parameters/result_params.py,sha256=5Mk9L9zWaxUqcKwLZQ539lVUp0b0s-YUmSA3PBgbqfs,2833
|
|
19
19
|
icsDataValidation/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
icsDataValidation/services/comparison_service.py,sha256=
|
|
20
|
+
icsDataValidation/services/comparison_service.py,sha256=x8RjZs2bgYDHFueq5ysNADY1cC6rYBf6eDyCsF-_w84,42705
|
|
21
21
|
icsDataValidation/services/initialization_service.py,sha256=AHbJrq_LjMPFoeOJC2pi2ZZ1xkL8njSZn38psc3do60,6687
|
|
22
|
-
icsDataValidation/services/result_service.py,sha256=
|
|
22
|
+
icsDataValidation/services/result_service.py,sha256=XwesiZjs8nAFD4wTYM_Fd1xEH_Txug3mj1FzpAg7o7c,28339
|
|
23
23
|
icsDataValidation/services/system_service.py,sha256=GSkSPNG5PlLWchwlYM5H-1FMtuCNwpXcyZZOUB_0stU,3228
|
|
24
24
|
icsDataValidation/services/testset_service.py,sha256=k1wRjI4Ltw9fylek9iW8N6DvnXn13wf6IJ703qQDMEc,15363
|
|
25
25
|
icsDataValidation/services/database_services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -36,7 +36,7 @@ icsDataValidation/utils/logger_util.py,sha256=xS48_FFMot_hyQgJY8DUeRTn5jpdvRt5QI
|
|
|
36
36
|
icsDataValidation/utils/pandas_util.py,sha256=D_g7Xw7BIS2E-1ZhJIvp62K5xuKjIkj-7TxH4HN_8SI,6505
|
|
37
37
|
icsDataValidation/utils/parallelization_util.py,sha256=6P0YcQLmunW_fHR4f5-kdncZbOlxxqKyk6ZAFQQEd2k,2088
|
|
38
38
|
icsDataValidation/utils/sql_util.py,sha256=0c-BInElSsRmXUedfLP_h9Wsiscv9aic7IIc5f15Uzo,396
|
|
39
|
-
icsDataValidation-1.0.
|
|
40
|
-
icsDataValidation-1.0.
|
|
41
|
-
icsDataValidation-1.0.
|
|
42
|
-
icsDataValidation-1.0.
|
|
39
|
+
icsDataValidation-1.0.273.dist-info/METADATA,sha256=Ya2fksiXg3MA7a8LkygIvQuTjOCkFFSIch9fJ_5fKGI,720
|
|
40
|
+
icsDataValidation-1.0.273.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
41
|
+
icsDataValidation-1.0.273.dist-info/top_level.txt,sha256=YL9V1qreCXZeUCy-tzA4Vxv5-6mvXy5lsfAT0nQapfg,53
|
|
42
|
+
icsDataValidation-1.0.273.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|