dcs-sdk 2.3.2__tar.gz → 2.3.4__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.
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/PKG-INFO +2 -2
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/README.md +1 -1
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/datasource/sql_datasource.py +17 -1
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/datasource/structure_probes.py +89 -3
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/mssql.py +12 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/postgres.py +10 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/__version__.py +1 -1
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/config/config_loader.py +69 -2
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/data_diff/data_differ.py +24 -2
- dcs_sdk-2.3.4/dcs_sdk/sdk/utils/metrics.py +280 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/pyproject.toml +1 -1
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/__main__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/abcs/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/abcs/compiler.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/abcs/database_types.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/config.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/_connect.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/base.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/bigquery.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/clickhouse.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/databricks.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/db2.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/duckdb.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/mssql.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/mysql.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/oracle.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/postgresql.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/presto.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/redis.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/redshift.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/sap_hana.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/snowflake.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/sybase.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/trino.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/databases/vertica.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/diff_tables.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/errors.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/format.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/hashdiff_tables.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/info_tree.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/joindiff_tables.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/lexicographic_space.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/parse_time.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/py.typed +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/queries/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/queries/api.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/queries/ast_classes.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/queries/base.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/queries/extras.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/query_utils.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/schema.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/streaming.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/table_segment.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/thread_utils.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/utils.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/data_diff/version.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/__main__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/__version__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/cli/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/cli/cli.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/errors.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/models/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/models/configuration.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/models/dashboard.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/models/data_source_resource.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/models/metric.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/models/profile.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/models/validation.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/common/models/widget.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/configuration/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/configuration/config_loader.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/configuration/configuration_parser.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/configuration/configuration_parser_arc.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/datasource/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/datasource/base.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/datasource/file_datasource.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/datasource/manager.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/datasource/search_datasource.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/inspect.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/logger/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/logger/base.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/logger/default_logger.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/metric/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/metric/base.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/metric/combined_metric.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/metric/custom_metric.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/metric/manager.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/metric/numeric_metric.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/metric/reliability_metric.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/observability/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/observability/connection_observer.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/profiling/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/profiling/datasource_profiling.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/profiling/numeric_field_profiling.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/profiling/text_field_profiling.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/repository/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/repository/metric_repository.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/utils/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/utils/log.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/utils/tracking.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/utils/utils.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/base.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/completeness_validation.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/custom_query_validation.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/manager.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/numeric_validation.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/reliability_validation.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/uniqueness_validation.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/core/validation/validity_validation.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/azure_blob.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/bigquery.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/clickhouse.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/databricks.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/db2.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/duck_db.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/elasticsearch.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/mysql.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/opensearch.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/oracle.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/presto.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/redshift.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/sap_hana.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/snowflake.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/spark_df.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/sybase.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/trino.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/databases/vertica.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/storage/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/storage/local_file.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/utils/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/integrations/utils/utils.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/dashboard.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/models.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/assets/fonts/DMSans-Bold.ttf +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/assets/fonts/DMSans-Medium.ttf +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/assets/fonts/DMSans-Regular.ttf +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/assets/fonts/DMSans-SemiBold.ttf +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/assets/images/docs.svg +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/assets/images/github.svg +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/assets/images/logo.svg +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/assets/images/slack.svg +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/index.js +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_core/report/static/index.js.LICENSE.txt +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/__main__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/cli/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/cli/cli.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/config/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/data_diff/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/rules/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/rules/rules_mappping.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/rules/rules_repository.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/rules/schema_rules.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/serializer.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/similarity_score/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/similarity_score/base_provider.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/similarity_score/cosine_similarity_provider.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/similarity_score/jaccard_provider.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/similarity_score/levenshtein_distance_provider.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/table.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/themes.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/sdk/utils/utils.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/utils/__init__.py +0 -0
- {dcs_sdk-2.3.2 → dcs_sdk-2.3.4}/dcs_sdk/utils/temp_objects.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dcs-sdk
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.4
|
|
4
4
|
Summary: SDK for DataChecks
|
|
5
5
|
Author: Waterdip Labs
|
|
6
6
|
Author-email: hello@waterdip.ai
|
|
@@ -94,7 +94,7 @@ Requires-Dist: virtualenv (>=20.36.2,<21.0.0)
|
|
|
94
94
|
Description-Content-Type: text/markdown
|
|
95
95
|
|
|
96
96
|
<h1 align="center">
|
|
97
|
-
DCS SDK v2.3.
|
|
97
|
+
DCS SDK v2.3.4
|
|
98
98
|
</h1>
|
|
99
99
|
|
|
100
100
|
> SDK for DataChecks
|
|
@@ -1905,6 +1905,12 @@ class SQLDataSource(DataSource):
|
|
|
1905
1905
|
"""The first ``limit`` rows, unordered. See StructureProbeMixin."""
|
|
1906
1906
|
raise self._structure_probes_unsupported("structure_sample_rows")
|
|
1907
1907
|
|
|
1908
|
+
def structure_spread_sample_rows(
|
|
1909
|
+
self, table: str, columns: List[ProbeColumn], limit: int
|
|
1910
|
+
) -> Tuple[List[tuple], List[str], bool]:
|
|
1911
|
+
"""Rows from pages across the table. See StructureProbeMixin."""
|
|
1912
|
+
raise self._structure_probes_unsupported("structure_spread_sample_rows")
|
|
1913
|
+
|
|
1908
1914
|
def structure_duplicate_group_count(self, table: str, columns: List[ProbeColumn]) -> int:
|
|
1909
1915
|
"""Value tuples occurring more than once. See StructureProbeMixin."""
|
|
1910
1916
|
raise self._structure_probes_unsupported("structure_duplicate_group_count")
|
|
@@ -1925,7 +1931,11 @@ class SQLDataSource(DataSource):
|
|
|
1925
1931
|
raise self._structure_probes_unsupported("structure_duplicate_group_rows")
|
|
1926
1932
|
|
|
1927
1933
|
def structure_distinct_tuple_count(
|
|
1928
|
-
self,
|
|
1934
|
+
self,
|
|
1935
|
+
table: str,
|
|
1936
|
+
columns: List[ProbeColumn],
|
|
1937
|
+
non_null_only: bool = False,
|
|
1938
|
+
where_not_null: List[ProbeColumn] = (),
|
|
1929
1939
|
) -> int:
|
|
1930
1940
|
"""Distinct value tuples. See StructureProbeMixin."""
|
|
1931
1941
|
raise self._structure_probes_unsupported("structure_distinct_tuple_count")
|
|
@@ -1946,6 +1956,12 @@ class SQLDataSource(DataSource):
|
|
|
1946
1956
|
"""Distinct child key tuples with no parent row. See StructureProbeMixin."""
|
|
1947
1957
|
raise self._structure_probes_unsupported("structure_orphan_count")
|
|
1948
1958
|
|
|
1959
|
+
def structure_distinct_values(
|
|
1960
|
+
self, table: str, columns: List[ProbeColumn], limit: int, binary: bool = False
|
|
1961
|
+
) -> Tuple[List[Tuple[str, ...]], bool]:
|
|
1962
|
+
"""See ``StructureProbeMixin.structure_distinct_values``."""
|
|
1963
|
+
raise self._structure_probes_unsupported("structure_distinct_values")
|
|
1964
|
+
|
|
1949
1965
|
def structure_session_setup(self, statement_timeout_s: int, read_only: bool = True) -> None:
|
|
1950
1966
|
"""Statement timeout and read-only session. See StructureProbeMixin."""
|
|
1951
1967
|
raise self._structure_probes_unsupported("structure_session_setup")
|
|
@@ -110,6 +110,16 @@ class StructureProbeMixin:
|
|
|
110
110
|
"""A row-limit suffix for the query (``" LIMIT n"``), or ``""``."""
|
|
111
111
|
return f" FETCH FIRST {n} ROWS ONLY"
|
|
112
112
|
|
|
113
|
+
def _probe_row_estimate(self, table: str) -> Optional[int]:
|
|
114
|
+
"""The table's row count from the catalog's statistics, without reading
|
|
115
|
+
it, or None when the engine keeps none (or never gathered them)."""
|
|
116
|
+
return None
|
|
117
|
+
|
|
118
|
+
def _probe_tablesample(self, percent: float) -> str:
|
|
119
|
+
"""A page-sampling clause for after the table (``" TABLESAMPLE SYSTEM
|
|
120
|
+
(p)"``), or ``""`` when the engine has none."""
|
|
121
|
+
return ""
|
|
122
|
+
|
|
113
123
|
def _probe_masked_columns(self, table: str) -> Set[str]:
|
|
114
124
|
"""Columns whose values this login sees masked, so their value counts
|
|
115
125
|
are meaningless. Engines without data masking return an empty set."""
|
|
@@ -264,6 +274,43 @@ class StructureProbeMixin:
|
|
|
264
274
|
rows, _ = self.fetchall_with_col_names(self._probe_select(items, f"FROM {self._probe_table(table)}", limit))
|
|
265
275
|
return self.normalize_sample_rows(rows), [c.name for c in cols]
|
|
266
276
|
|
|
277
|
+
def structure_spread_sample_rows(
|
|
278
|
+
self, table: str, columns: Sequence[ProbeColumn], limit: int
|
|
279
|
+
) -> Tuple[List[tuple], List[str], bool]:
|
|
280
|
+
"""Up to ``limit`` rows from pages across the whole table, where
|
|
281
|
+
``structure_sample_rows`` reads its first pages only -- the oldest
|
|
282
|
+
rows, often one region or one date range.
|
|
283
|
+
|
|
284
|
+
A large table is read through ``TABLESAMPLE SYSTEM``: whole pages
|
|
285
|
+
picked at random, no scan and no sort, about twice ``limit`` rows'
|
|
286
|
+
worth so the cap is usually reached. A table the statistics put at
|
|
287
|
+
under twice ``limit`` rows, an engine with no sampling, a view, or a
|
|
288
|
+
sample that came back empty, is read from the start instead.
|
|
289
|
+
|
|
290
|
+
:return: ``(rows, column_names, whole)``; ``whole`` is True when the
|
|
291
|
+
rows are every row of the table.
|
|
292
|
+
"""
|
|
293
|
+
self._probe_check_table(table)
|
|
294
|
+
cols = self._probe_check_columns(columns, "structure_spread_sample_rows")
|
|
295
|
+
limit = self._probe_check_positive(limit, "limit")
|
|
296
|
+
items = ", ".join(self._probe_col(c) for c in cols)
|
|
297
|
+
names = [c.name for c in cols]
|
|
298
|
+
try:
|
|
299
|
+
estimate = self._probe_row_estimate(table)
|
|
300
|
+
except Exception: # noqa: BLE001 -- no statistics: read from the start
|
|
301
|
+
estimate = None
|
|
302
|
+
clause = self._probe_tablesample(min(100.0, 200.0 * limit / estimate)) if estimate else ""
|
|
303
|
+
if estimate and estimate > 2 * limit and clause:
|
|
304
|
+
query = self._probe_select(items, f"FROM {self._probe_table(table)}{clause}", limit)
|
|
305
|
+
try:
|
|
306
|
+
rows, _ = self.fetchall_with_col_names(query)
|
|
307
|
+
except Exception: # noqa: BLE001 -- a view, or sampling refused
|
|
308
|
+
rows = []
|
|
309
|
+
if rows:
|
|
310
|
+
return self.normalize_sample_rows(rows), names, False
|
|
311
|
+
rows, _ = self.fetchall_with_col_names(self._probe_select(items, f"FROM {self._probe_table(table)}", limit))
|
|
312
|
+
return self.normalize_sample_rows(rows), names, len(rows) < limit
|
|
313
|
+
|
|
267
314
|
def structure_duplicate_group_count(self, table: str, columns: Sequence[ProbeColumn]) -> int:
|
|
268
315
|
"""How many value tuples of ``columns`` occur more than once. 0 means
|
|
269
316
|
the columns are unique (a NULL tuple groups like any other value)."""
|
|
@@ -331,14 +378,23 @@ class StructureProbeMixin:
|
|
|
331
378
|
return self.normalize_sample_rows(rows), ["_g"] + [c.name for c in cols]
|
|
332
379
|
|
|
333
380
|
def structure_distinct_tuple_count(
|
|
334
|
-
self,
|
|
381
|
+
self,
|
|
382
|
+
table: str,
|
|
383
|
+
columns: Sequence[ProbeColumn],
|
|
384
|
+
non_null_only: bool = False,
|
|
385
|
+
where_not_null: Sequence[ProbeColumn] = (),
|
|
335
386
|
) -> int:
|
|
336
387
|
"""How many distinct value tuples ``columns`` hold. With
|
|
337
|
-
``non_null_only``, rows with a NULL in any of them are left out
|
|
388
|
+
``non_null_only``, rows with a NULL in any of them are left out; with
|
|
389
|
+
``where_not_null``, rows with a NULL in any of those columns only, so a
|
|
390
|
+
key's NULL can drop the row while another column's NULL still counts."""
|
|
338
391
|
self._probe_check_table(table)
|
|
339
392
|
cols = self._probe_check_columns(columns, "structure_distinct_tuple_count")
|
|
340
393
|
group = ", ".join(self._probe_group_expr(table, c) for c in cols)
|
|
341
|
-
|
|
394
|
+
required = cols if non_null_only else []
|
|
395
|
+
if where_not_null:
|
|
396
|
+
required = [*required, *self._probe_check_columns(where_not_null, "structure_distinct_tuple_count")]
|
|
397
|
+
where = f" WHERE {self._probe_not_null(required)}" if required else ""
|
|
342
398
|
inner = f"SELECT 1 AS x FROM {self._probe_table(table)}{where} GROUP BY {group}"
|
|
343
399
|
return self._probe_scalar(f"SELECT {self._probe_count()}(*) AS n FROM ({inner}) d")
|
|
344
400
|
|
|
@@ -402,6 +458,36 @@ class StructureProbeMixin:
|
|
|
402
458
|
)
|
|
403
459
|
return self._probe_scalar(f"SELECT {self._probe_count()}(*) AS n FROM ({inner}) o")
|
|
404
460
|
|
|
461
|
+
def structure_distinct_values(
|
|
462
|
+
self, table: str, columns: Sequence[ProbeColumn], limit: int, binary: bool = False
|
|
463
|
+
) -> Tuple[List[Tuple[str, ...]], bool]:
|
|
464
|
+
"""The distinct value tuples of ``columns`` with none of them NULL, each
|
|
465
|
+
value in the engine's text form, at most ``limit`` tuples, sorted here
|
|
466
|
+
rather than by the engine: an unordered ``TOP`` / ``LIMIT`` lets it stop
|
|
467
|
+
once it has enough, where ``ORDER BY`` makes it find and sort every
|
|
468
|
+
distinct tuple of a large table first.
|
|
469
|
+
|
|
470
|
+
The text form is the one ``structure_orphan_count(compare="text")``
|
|
471
|
+
compares by, so tuples read from two databases can be compared with
|
|
472
|
+
each other in the caller -- a lookup's source codes against the codes a
|
|
473
|
+
reference table holds, say. ``binary=True`` reads them under a binary
|
|
474
|
+
collation, so values differing only in case stay distinct.
|
|
475
|
+
|
|
476
|
+
:return: ``(tuples, complete)``; ``complete`` is False when there are
|
|
477
|
+
more than ``limit`` distinct tuples and the list was cut.
|
|
478
|
+
:raises StructureProbeColumnUnsupported: before any SQL, when a column
|
|
479
|
+
has no text form.
|
|
480
|
+
"""
|
|
481
|
+
self._probe_check_table(table)
|
|
482
|
+
cols = self._probe_check_columns(columns, "structure_distinct_values")
|
|
483
|
+
limit = self._probe_check_positive(limit, "limit")
|
|
484
|
+
items = ", ".join(f"{self._probe_text_expr(table, c, 't', binary)} AS v_{i}" for i, c in enumerate(cols))
|
|
485
|
+
inner = f"SELECT DISTINCT {items} FROM {self._probe_table(table)} t WHERE {self._probe_not_null(cols, 't')}"
|
|
486
|
+
outer = ", ".join(f"d.v_{i}" for i in range(len(cols)))
|
|
487
|
+
rows = self.fetchall(self._probe_select(outer, f"FROM ({inner}) d", limit + 1))
|
|
488
|
+
tuples = sorted(tuple(str(v) for v in r) for r in rows or [] if all(v is not None for v in r))
|
|
489
|
+
return tuples[:limit], len(tuples) <= limit
|
|
490
|
+
|
|
405
491
|
def structure_session_setup(self, statement_timeout_s: int, read_only: bool = True) -> None:
|
|
406
492
|
"""Bound every later query on this connection by ``statement_timeout_s``
|
|
407
493
|
seconds (0 disables the bound, as on both engines), and make the
|
|
@@ -540,6 +540,18 @@ class MssqlDataSource(StructureProbeMixin, SQLDataSource):
|
|
|
540
540
|
def _probe_limit(self, n: int) -> str:
|
|
541
541
|
return ""
|
|
542
542
|
|
|
543
|
+
def _probe_row_estimate(self, table: str) -> Optional[int]:
|
|
544
|
+
"""Rows of the heap or clustered index, from ``sys.partitions``."""
|
|
545
|
+
name = self._probe_table(table).replace("'", "''")
|
|
546
|
+
row = self.fetchone(
|
|
547
|
+
"SELECT SUM(p.rows) FROM sys.partitions p "
|
|
548
|
+
f"WHERE p.object_id = OBJECT_ID(N'{name}') AND p.index_id IN (0, 1)"
|
|
549
|
+
)
|
|
550
|
+
return int(row[0]) if row and row[0] is not None else None
|
|
551
|
+
|
|
552
|
+
def _probe_tablesample(self, percent: float) -> str:
|
|
553
|
+
return f" TABLESAMPLE SYSTEM ({percent:.4f} PERCENT)"
|
|
554
|
+
|
|
543
555
|
def _probe_masked_columns(self, table: str) -> set:
|
|
544
556
|
""":meth:`_mask_blind_columns`, for the escaped table name."""
|
|
545
557
|
return set(self._mask_blind_columns(table, qualified=self._probe_table(table)))
|
|
@@ -137,6 +137,16 @@ class PostgresDataSource(StructureProbeMixin, SQLDataSource):
|
|
|
137
137
|
def _probe_limit(self, n: int) -> str:
|
|
138
138
|
return f" LIMIT {n}"
|
|
139
139
|
|
|
140
|
+
def _probe_row_estimate(self, table: str) -> Optional[int]:
|
|
141
|
+
"""``pg_class.reltuples``: -1 (or 0) until the table is first analyzed."""
|
|
142
|
+
name = self._probe_table(table).replace("'", "''")
|
|
143
|
+
row = self.fetchone(f"SELECT c.reltuples FROM pg_class c WHERE c.oid = to_regclass('{name}')")
|
|
144
|
+
value = row[0] if row else None
|
|
145
|
+
return int(value) if value is not None and value > 0 else None
|
|
146
|
+
|
|
147
|
+
def _probe_tablesample(self, percent: float) -> str:
|
|
148
|
+
return f" TABLESAMPLE SYSTEM ({percent:.4f})"
|
|
149
|
+
|
|
140
150
|
def _probe_session_setup(self, statement_timeout_s: int, read_only: bool) -> None:
|
|
141
151
|
"""``SET`` on this connection, which is AUTOCOMMIT, so both settings
|
|
142
152
|
last for the session. ``read_only=False`` leaves the session's read-only
|
|
@@ -96,6 +96,25 @@ class DiffAdvancedConfig(BaseModel):
|
|
|
96
96
|
in_memory_diff: bool = False # Whether to perform diff in memory (may use more RAM)
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
METRIC_FNS = ("sum", "count_distinct", "null_count", "distribution")
|
|
100
|
+
DIFF_MODES = ("full", "keys", "none")
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class MetricConfig(BaseModel):
|
|
104
|
+
"""One two-sided measurement, run once per side on the compared table/query.
|
|
105
|
+
|
|
106
|
+
Columns are named on the source side; the loader fills the target names
|
|
107
|
+
through the comparison's column mapping. ``null_count`` takes several
|
|
108
|
+
columns, every other fn exactly one. ``top`` caps distribution groups.
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
id: str
|
|
112
|
+
fn: Literal["sum", "count_distinct", "null_count", "distribution"]
|
|
113
|
+
source_columns: List[str]
|
|
114
|
+
target_columns: List[str]
|
|
115
|
+
top: int = 1000
|
|
116
|
+
|
|
117
|
+
|
|
99
118
|
class Comparison(BaseModel):
|
|
100
119
|
comparison_name: str
|
|
101
120
|
job_id: Optional[int] = None
|
|
@@ -128,6 +147,10 @@ class Comparison(BaseModel):
|
|
|
128
147
|
masking_character: str = "*"
|
|
129
148
|
schema_diff: bool = False # Used for schema diff
|
|
130
149
|
case_sensitive: bool = True # When False, column name matching is case-insensitive end-to-end
|
|
150
|
+
# full = key + value diff (default); keys = key-only diff (exclusive/duplicate
|
|
151
|
+
# keys, no value compare); none = no row diff (counts, schema, metrics only).
|
|
152
|
+
diff_mode: Literal["full", "keys", "none"] = "full"
|
|
153
|
+
metrics: List[MetricConfig] = []
|
|
131
154
|
|
|
132
155
|
|
|
133
156
|
class EnvYamlLoader(yaml.SafeLoader):
|
|
@@ -443,19 +466,27 @@ class DataDiffConfig:
|
|
|
443
466
|
case_sensitive = comparison_data.get("case_sensitive", True)
|
|
444
467
|
target_columns = [source_to_target.get(col, col) for col in source_columns]
|
|
445
468
|
schema_diff = comparison_data.get("schema_diff", False)
|
|
469
|
+
diff_mode = comparison_data.get("diff_mode") or "full"
|
|
470
|
+
if diff_mode not in DIFF_MODES:
|
|
471
|
+
raise ValueError(f"Invalid diff_mode: {diff_mode}")
|
|
446
472
|
if quick_comparison and schema_diff:
|
|
447
473
|
raise ValueError("quick_comparison and schema_diff cannot be used together")
|
|
474
|
+
if quick_comparison and diff_mode == "none":
|
|
475
|
+
raise ValueError("quick_comparison needs a row diff; diff_mode none has none")
|
|
448
476
|
assert len(source_columns) == len(
|
|
449
477
|
target_columns
|
|
450
478
|
), "source_columns and target_columns must have the same length"
|
|
451
|
-
|
|
479
|
+
# Value columns are only needed when values are diffed.
|
|
480
|
+
if not schema_diff and diff_mode == "full" and not (source_columns or target_columns):
|
|
452
481
|
raise MissingRequiredFieldError("source_columns and target_columns are required for comparison")
|
|
453
482
|
|
|
454
483
|
primary_keys_source = comparison_data.get("key_columns", [])
|
|
455
|
-
if not primary_keys_source and not schema_diff:
|
|
484
|
+
if not primary_keys_source and not schema_diff and diff_mode != "none":
|
|
456
485
|
raise MissingRequiredFieldError("key_columns are required for comparison")
|
|
457
486
|
primary_keys_target = [source_to_target.get(pk, pk) for pk in primary_keys_source]
|
|
458
487
|
|
|
488
|
+
metrics = self.get_metrics(comparison_data.get("metrics") or [], source_to_target)
|
|
489
|
+
|
|
459
490
|
similarity_data = comparison_data.get("similarity")
|
|
460
491
|
similarity = (
|
|
461
492
|
SimilarityConfig(
|
|
@@ -520,11 +551,47 @@ class DataDiffConfig:
|
|
|
520
551
|
"masking_character": masking_character,
|
|
521
552
|
"schema_diff": schema_diff,
|
|
522
553
|
"case_sensitive": case_sensitive,
|
|
554
|
+
"diff_mode": diff_mode,
|
|
555
|
+
"metrics": metrics,
|
|
523
556
|
}
|
|
524
557
|
new_structure.append(Comparison(**new_comparison))
|
|
525
558
|
|
|
526
559
|
return new_structure
|
|
527
560
|
|
|
561
|
+
@staticmethod
|
|
562
|
+
def get_metrics(metrics_data: List[dict], source_to_target: Dict[str, str]) -> List[MetricConfig]:
|
|
563
|
+
"""Validate metric entries; name target columns through the column mapping."""
|
|
564
|
+
metrics = []
|
|
565
|
+
seen_ids = set()
|
|
566
|
+
for item in metrics_data:
|
|
567
|
+
metric_id = item.get("id")
|
|
568
|
+
fn = item.get("fn")
|
|
569
|
+
if not metric_id:
|
|
570
|
+
raise MissingRequiredFieldError("id is required for metric")
|
|
571
|
+
if metric_id in seen_ids:
|
|
572
|
+
raise ValueError(f"Duplicate metric id: {metric_id}")
|
|
573
|
+
seen_ids.add(metric_id)
|
|
574
|
+
if fn not in METRIC_FNS:
|
|
575
|
+
raise ValueError(f"Invalid metric fn '{fn}' for metric {metric_id}")
|
|
576
|
+
columns = item.get("columns") or ([item["column"]] if item.get("column") else [])
|
|
577
|
+
if not columns:
|
|
578
|
+
raise MissingRequiredFieldError(f"column is required for metric {metric_id}")
|
|
579
|
+
if fn != "null_count" and len(columns) != 1:
|
|
580
|
+
raise ValueError(f"metric {metric_id}: {fn} takes exactly one column")
|
|
581
|
+
top = item.get("top") or 1000
|
|
582
|
+
if top < 1:
|
|
583
|
+
raise ValueError(f"metric {metric_id}: top must be at least 1")
|
|
584
|
+
metrics.append(
|
|
585
|
+
MetricConfig(
|
|
586
|
+
id=metric_id,
|
|
587
|
+
fn=fn,
|
|
588
|
+
source_columns=columns,
|
|
589
|
+
target_columns=[source_to_target.get(c, c) for c in columns],
|
|
590
|
+
top=top,
|
|
591
|
+
)
|
|
592
|
+
)
|
|
593
|
+
return metrics
|
|
594
|
+
|
|
528
595
|
def _build_query(self, column, transformation_template):
|
|
529
596
|
transformation_query = transformation_template.format(column=column)
|
|
530
597
|
return transformation_query
|
|
@@ -30,6 +30,7 @@ from data_diff.databases._connect import DATABASE_BY_SCHEME
|
|
|
30
30
|
from data_diff.databases.redis import RedisBackend
|
|
31
31
|
from dcs_sdk.sdk.config.config_loader import Comparison, SourceTargetConnection
|
|
32
32
|
from dcs_sdk.sdk.rules.rules_repository import RulesRepository
|
|
33
|
+
from dcs_sdk.sdk.utils.metrics import run_metrics
|
|
33
34
|
from dcs_sdk.sdk.utils.serializer import serialize_table_schema
|
|
34
35
|
from dcs_sdk.sdk.utils.table import create_table_schema_row_count, differ_rows
|
|
35
36
|
from dcs_sdk.sdk.utils.themes import theme_1
|
|
@@ -330,6 +331,10 @@ class DBTableDiffer:
|
|
|
330
331
|
)
|
|
331
332
|
return rows
|
|
332
333
|
|
|
334
|
+
def _folds_names(self, driver: str) -> bool:
|
|
335
|
+
"""Names were upper-cased for this side (case-insensitive run, uppercase dialect)."""
|
|
336
|
+
return not self.config.case_sensitive and self._driver_folds_to_uppercase(driver)
|
|
337
|
+
|
|
333
338
|
@staticmethod
|
|
334
339
|
def _driver_folds_to_uppercase(driver: str) -> bool:
|
|
335
340
|
"""Returns True if the database for this driver folds unquoted identifiers to uppercase.
|
|
@@ -358,6 +363,10 @@ class DBTableDiffer:
|
|
|
358
363
|
primary_keys = self.config.primary_keys_target
|
|
359
364
|
columns = self.config.target_columns
|
|
360
365
|
where = self.config.target_filter
|
|
366
|
+
# Keys/none modes hash key columns only; value columns stay in the
|
|
367
|
+
# config for the schema mapping but never enter the row diff.
|
|
368
|
+
if self.config.diff_mode != "full":
|
|
369
|
+
columns = []
|
|
361
370
|
|
|
362
371
|
if not self.config.case_sensitive and self._driver_folds_to_uppercase(config.driver):
|
|
363
372
|
primary_keys = [k.upper() for k in primary_keys]
|
|
@@ -675,6 +684,17 @@ class DBTableDiffer:
|
|
|
675
684
|
# UI can populate the Schema overview table before the diff even runs.
|
|
676
685
|
self._emit_schema_event(source_dataset, target_dataset, columns_mappings)
|
|
677
686
|
|
|
687
|
+
metrics = run_metrics(
|
|
688
|
+
self.table1,
|
|
689
|
+
self.table2,
|
|
690
|
+
self.config.metrics,
|
|
691
|
+
table_1_row_count,
|
|
692
|
+
table_2_row_count,
|
|
693
|
+
source_upper=self._folds_names(self.config.source.driver),
|
|
694
|
+
target_upper=self._folds_names(self.config.target.driver),
|
|
695
|
+
)
|
|
696
|
+
run_row_diff = self.config.diff_mode != "none" and not self.config.schema_diff
|
|
697
|
+
|
|
678
698
|
is_bisection_threshold_automatic = self.config.advanced_configuration.bisection_threshold == -1
|
|
679
699
|
is_bisection_factor_automatic = self.config.advanced_configuration.bisection_factor == -1
|
|
680
700
|
is_egress_limit_automatic = self.config.advanced_configuration.egress_limit == -1
|
|
@@ -712,7 +732,7 @@ class DBTableDiffer:
|
|
|
712
732
|
else:
|
|
713
733
|
error_message = f"Target table '{target_dataset.get('table_name')}' is empty"
|
|
714
734
|
is_table_empty = True
|
|
715
|
-
if not is_table_empty and
|
|
735
|
+
if not is_table_empty and run_row_diff:
|
|
716
736
|
# Fetch schemas and adjust precision before getting sample data,
|
|
717
737
|
# so that numeric values are normalized consistently (e.g., 12.60 vs 12.6000000000).
|
|
718
738
|
from data_diff.hashdiff_tables import HashDiffer as _HashDiffer
|
|
@@ -750,7 +770,7 @@ class DBTableDiffer:
|
|
|
750
770
|
}
|
|
751
771
|
|
|
752
772
|
self.process_limit(max_row_count)
|
|
753
|
-
if not is_table_empty and
|
|
773
|
+
if not is_table_empty and run_row_diff:
|
|
754
774
|
diff_res = differ_rows(
|
|
755
775
|
diff_iter=self.diff_iter,
|
|
756
776
|
response=self.response,
|
|
@@ -868,6 +888,8 @@ class DBTableDiffer:
|
|
|
868
888
|
- self.response["target_dataset"]["null_pk_cnt"]
|
|
869
889
|
)
|
|
870
890
|
self.response.update(diff_res)
|
|
891
|
+
self.response["diff_mode"] = "none" if self.config.schema_diff else self.config.diff_mode
|
|
892
|
+
self.response["metrics"] = metrics
|
|
871
893
|
if show_stats:
|
|
872
894
|
self.print_stats()
|
|
873
895
|
table_1_stats = self.table1.query_stats
|