google-pso-data-validator 6.1.0__tar.gz → 6.2.0__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.
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/PKG-INFO +72 -37
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/README.md +53 -13
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/__main__.py +1 -66
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/cli_tools.py +29 -16
- google_pso_data_validator-6.2.0/data_validation/find_tables.py +148 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/query_builder/partition_row_builder.py +1 -1
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/result_handlers/bigquery.py +1 -1
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/result_handlers/text.py +1 -1
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/google_pso_data_validator.egg-info/PKG-INFO +72 -37
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/google_pso_data_validator.egg-info/SOURCES.txt +1 -0
- google_pso_data_validator-6.2.0/google_pso_data_validator.egg-info/requires.txt +26 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/setup.py +21 -28
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_db2/registry.py +1 -1
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_oracle/__init__.py +45 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_teradata/registry.py +7 -0
- google_pso_data_validator-6.1.0/google_pso_data_validator.egg-info/requires.txt +0 -31
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/LICENSE +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/app.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/client_info.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/clients.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/combiner.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/config_manager.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/consts.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/data_validation.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/exceptions.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/gcs_helper.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/jellyfish_distance.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/metadata.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/partition_builder.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/query_builder/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/query_builder/query_builder.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/query_builder/random_row_builder.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/result_handlers/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/schema_validation.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/secret_manager.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/state_manager.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/validation_builder.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/google_pso_data_validator.egg-info/dependency_links.txt +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/google_pso_data_validator.egg-info/entry_points.txt +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/google_pso_data_validator.egg-info/top_level.txt +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/setup.cfg +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_addon/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_addon/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_addon/operations.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/client.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/compiler.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/datatypes.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/registry.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/tests/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/tests/conftest.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_cloud_spanner/to_pandas.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_db2/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_db2/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_db2/compiler.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_db2/datatypes.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_impala/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_impala/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_mssql/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_mssql/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_mssql/datatypes.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_mssql/registry.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_mysql/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_mysql/base_sql_compiler/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_mysql/base_sql_compiler/select_builder.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_mysql/compiler.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_oracle/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_oracle/compiler.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_oracle/datatypes.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_oracle/registry.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_postgres/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_postgres/client.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_postgres/datatypes.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_redshift/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_redshift/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_redshift/compiler.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_snowflake/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_snowflake/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_snowflake/datatypes.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_teradata/__init__.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_teradata/api.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_teradata/compiler.py +0 -0
- {google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/third_party/ibis/ibis_teradata/datatypes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: google-pso-data-validator
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.2.0
|
|
4
4
|
Summary: A package to enable easy data validation
|
|
5
5
|
Author: PSO DVT Engineering team
|
|
6
6
|
Author-email: data-validator-eng@google.com
|
|
@@ -14,31 +14,26 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Requires-Python: >=3.8
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist:
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist: google-
|
|
17
|
+
Requires-Dist: Flask>=2.2
|
|
18
|
+
Requires-Dist: fsspec>=2024.9.0
|
|
19
|
+
Requires-Dist: google-api-python-client>=2.144.0
|
|
20
|
+
Requires-Dist: google-cloud-bigquery>=3.25.0
|
|
21
|
+
Requires-Dist: google-cloud-bigquery-storage>=2.26.0
|
|
22
|
+
Requires-Dist: google-cloud-secret-manager>=2.20.2
|
|
23
|
+
Requires-Dist: google-cloud-spanner>=3.49.1
|
|
24
|
+
Requires-Dist: google-cloud-storage>=2.18.2
|
|
23
25
|
Requires-Dist: ibis-framework==5.1.0
|
|
24
|
-
Requires-Dist: impyla
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist: pandas==1.5.3
|
|
30
|
-
Requires-Dist: proto-plus==1.22.3
|
|
26
|
+
Requires-Dist: impyla>=0.19.0
|
|
27
|
+
Requires-Dist: jellyfish>=1.1.0
|
|
28
|
+
Requires-Dist: pandas==2.0.3
|
|
29
|
+
Requires-Dist: parsy>=2.1
|
|
30
|
+
Requires-Dist: psycopg2-binary>=2.9.9
|
|
31
31
|
Requires-Dist: pyarrow==14.0.1
|
|
32
|
-
Requires-Dist: pydata-google-auth
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist: jellyfish==1.0.0
|
|
38
|
-
Requires-Dist: tabulate==0.9.0
|
|
39
|
-
Requires-Dist: Flask==2.3.2
|
|
40
|
-
Requires-Dist: parsy==2.1
|
|
41
|
-
Requires-Dist: google-cloud-secret-manager>=2.16.0
|
|
32
|
+
Requires-Dist: pydata-google-auth>=1.8.2
|
|
33
|
+
Requires-Dist: PyMySQL>=1.1.1
|
|
34
|
+
Requires-Dist: PyYAML>=6.0.2
|
|
35
|
+
Requires-Dist: SQLAlchemy==1.4.49
|
|
36
|
+
Requires-Dist: tabulate>=0.9.0
|
|
42
37
|
Provides-Extra: apache-airflow
|
|
43
38
|
Requires-Dist: 1.10.11; extra == "apache-airflow"
|
|
44
39
|
Provides-Extra: pyspark
|
|
@@ -133,7 +128,12 @@ over all columns ('*') will only run over numeric columns, unless the
|
|
|
133
128
|
`--wildcard-include-string-len` or `--wildcard-include-timestamp` flags are present.
|
|
134
129
|
|
|
135
130
|
```
|
|
136
|
-
data-validation
|
|
131
|
+
data-validation
|
|
132
|
+
[--verbose or -v ]
|
|
133
|
+
Verbose logging
|
|
134
|
+
[--log-level or -ll]
|
|
135
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
136
|
+
validate column
|
|
137
137
|
--source-conn or -sc SOURCE_CONN
|
|
138
138
|
Source connection details
|
|
139
139
|
See: *Data Source Configurations* section for each data source
|
|
@@ -141,7 +141,7 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
141
141
|
Target connection details
|
|
142
142
|
See: *Connections* section for each data source
|
|
143
143
|
--tables-list or -tbls SOURCE_SCHEMA.SOURCE_TABLE=TARGET_SCHEMA.TARGET_TABLE
|
|
144
|
-
Comma separated list of tables in the form schema.table=target_schema.target_table
|
|
144
|
+
Comma separated list of tables in the form schema.table=target_schema.target_table. Or shorthand schema.* for all tables.
|
|
145
145
|
Target schema name and table name are optional.
|
|
146
146
|
i.e 'bigquery-public-data.new_york_citibike.citibike_trips'
|
|
147
147
|
[--grouped-columns or -gc GROUPED_COLUMNS]
|
|
@@ -182,6 +182,7 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
182
182
|
Format for stdout output. Supported formats are (text, csv, json, table). Defaults to table.
|
|
183
183
|
[--filter-status or -fs STATUSES_LIST]
|
|
184
184
|
Comma separated list of statuses to filter the validation results. Supported statuses are (success, fail). If no list is provided, all statuses are returned.
|
|
185
|
+
|
|
185
186
|
```
|
|
186
187
|
|
|
187
188
|
The default aggregation type is a 'COUNT *', which will run in addition to the validations you specify. To remove this default,
|
|
@@ -212,7 +213,12 @@ Under the hood, row validation uses
|
|
|
212
213
|
apply functions such as IFNULL() or RTRIM(). These can be edited in the YAML or JSON config file to customize your row validation.
|
|
213
214
|
|
|
214
215
|
```
|
|
215
|
-
data-validation
|
|
216
|
+
data-validation
|
|
217
|
+
[--verbose or -v ]
|
|
218
|
+
Verbose logging
|
|
219
|
+
[--log-level or -ll]
|
|
220
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
221
|
+
validate row
|
|
216
222
|
--source-conn or -sc SOURCE_CONN
|
|
217
223
|
Source connection details
|
|
218
224
|
See: *Data Source Configurations* section for each data source
|
|
@@ -270,8 +276,12 @@ The command generates and stores multiple YAML validations each representing a c
|
|
|
270
276
|
The command takes the same parameters as required for `Row Validation` *plus* a few parameters to support partitioning. Single and multiple primary keys are supported and keys can be of any indexable type, except for date and timestamp type. A parameter used in earlier versions, ```partition-key``` is no longer supported.
|
|
271
277
|
|
|
272
278
|
```
|
|
273
|
-
data-validation
|
|
274
|
-
|
|
279
|
+
data-validation
|
|
280
|
+
[--verbose or -v ]
|
|
281
|
+
Verbose logging
|
|
282
|
+
[--log-level or -ll]
|
|
283
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
284
|
+
generate-table-partitions
|
|
275
285
|
--source-conn or -sc SOURCE_CONN
|
|
276
286
|
Source connection details
|
|
277
287
|
See: *Data Source Configurations* section for each data source
|
|
@@ -293,7 +303,7 @@ data-validation (--verbose or -v) (--log-level or -ll) generate-table-partitions
|
|
|
293
303
|
Directory Path to store YAML Config Files
|
|
294
304
|
GCS: Provide a full gs:// path of the target directory. Eg: `gs://<BUCKET>/partitions_dir`
|
|
295
305
|
Local: Provide a relative path of the target directory. Eg: `partitions_dir`
|
|
296
|
-
--partition-num INT, -pn INT
|
|
306
|
+
--partition-num INT, -pn INT
|
|
297
307
|
Number of partitions into which the table should be split, e.g. 1000 or 10000
|
|
298
308
|
In case this value exceeds the row count of the source/target table, it will be decreased to max(source_row_count, target_row_count)
|
|
299
309
|
[--bq-result-handler or -bqrh PROJECT_ID.DATASET.TABLE]
|
|
@@ -301,7 +311,7 @@ data-validation (--verbose or -v) (--log-level or -ll) generate-table-partitions
|
|
|
301
311
|
See: *Validation Reports* section
|
|
302
312
|
[--service-account or -sa PATH_TO_SA_KEY]
|
|
303
313
|
Service account to use for BigQuery result handler output.
|
|
304
|
-
[--parts-per-file INT], [-ppf INT]
|
|
314
|
+
[--parts-per-file INT], [-ppf INT]
|
|
305
315
|
Number of partitions in a yaml file, default value 1.
|
|
306
316
|
[--filters SOURCE_FILTER:TARGET_FILTER]
|
|
307
317
|
Colon separated string values of source and target filters.
|
|
@@ -326,7 +336,12 @@ types between source and target.
|
|
|
326
336
|
Note: An exclamation point before a data type (`!string`) signifies the column is non-nullable or required.
|
|
327
337
|
|
|
328
338
|
```
|
|
329
|
-
data-validation
|
|
339
|
+
data-validation
|
|
340
|
+
[--verbose or -v ]
|
|
341
|
+
Verbose logging
|
|
342
|
+
[--log-level or -ll]
|
|
343
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
344
|
+
validate schema
|
|
330
345
|
--source-conn or -sc SOURCE_CONN
|
|
331
346
|
Source connection details
|
|
332
347
|
See: *Data Source Configurations* section for each data source
|
|
@@ -334,7 +349,7 @@ data-validation (--verbose or -v) (--log-level or -ll) validate schema
|
|
|
334
349
|
Target connection details
|
|
335
350
|
See: *Connections* section for each data source
|
|
336
351
|
--tables-list or -tbls SOURCE_SCHEMA.SOURCE_TABLE=TARGET_SCHEMA.TARGET_TABLE
|
|
337
|
-
Comma separated list of tables in the form schema.table=target_schema.target_table
|
|
352
|
+
Comma separated list of tables in the form schema.table=target_schema.target_table. Or shorthand schema.* for all tables.
|
|
338
353
|
Target schema name and table name are optional.
|
|
339
354
|
e.g.: 'bigquery-public-data.new_york_citibike.citibike_trips'
|
|
340
355
|
[--bq-result-handler or -bqrh PROJECT_ID.DATASET.TABLE]
|
|
@@ -367,7 +382,12 @@ data-validation (--verbose or -v) (--log-level or -ll) validate schema
|
|
|
367
382
|
Below is the command syntax for custom query column validations.
|
|
368
383
|
|
|
369
384
|
```
|
|
370
|
-
data-validation
|
|
385
|
+
data-validation
|
|
386
|
+
[--verbose or -v ]
|
|
387
|
+
Verbose logging
|
|
388
|
+
[--log-level or -ll]
|
|
389
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
390
|
+
validate custom-query column
|
|
371
391
|
--source-conn or -sc SOURCE_CONN
|
|
372
392
|
Source connection details
|
|
373
393
|
See: *Data Source Configurations* section for each data source
|
|
@@ -429,7 +449,12 @@ in the SELECT statement of both source_query.sql and target_query.sql. See *Pri
|
|
|
429
449
|
Below is the command syntax for custom query row validations.
|
|
430
450
|
|
|
431
451
|
```
|
|
432
|
-
data-validation
|
|
452
|
+
data-validation
|
|
453
|
+
[--verbose or -v ]
|
|
454
|
+
Verbose logging
|
|
455
|
+
[--log-level or -ll]
|
|
456
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
457
|
+
validate custom-query row
|
|
433
458
|
--source-conn or -sc SOURCE_CONN
|
|
434
459
|
Source connection details
|
|
435
460
|
See: *Data Source Configurations* section for each data source
|
|
@@ -487,7 +512,12 @@ The `validate` command takes a `--dry-run` command line flag that prints source
|
|
|
487
512
|
and target SQL to stdout as JSON in lieu of performing a validation:
|
|
488
513
|
|
|
489
514
|
```
|
|
490
|
-
data-validation
|
|
515
|
+
data-validation
|
|
516
|
+
[--verbose or -v ]
|
|
517
|
+
Verbose logging
|
|
518
|
+
[--log-level or -ll]
|
|
519
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
520
|
+
validate
|
|
491
521
|
[--dry-run or -dr] Prints source and target SQL to stdout in lieu of performing a validation.
|
|
492
522
|
```
|
|
493
523
|
|
|
@@ -518,7 +548,12 @@ GCS and local paths.
|
|
|
518
548
|
You can use the `data-validation configs` command to run and view YAMLs.
|
|
519
549
|
|
|
520
550
|
```
|
|
521
|
-
data-validation
|
|
551
|
+
data-validation
|
|
552
|
+
[--verbose or -v ]
|
|
553
|
+
Verbose logging
|
|
554
|
+
[--log-level or -ll]
|
|
555
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
556
|
+
configs run
|
|
522
557
|
[--config-file or -c CONFIG_FILE]
|
|
523
558
|
Path to YAML config file to run. Supports local and GCS paths.
|
|
524
559
|
[--config-dir or -cdir CONFIG_DIR]
|
|
@@ -87,7 +87,12 @@ over all columns ('*') will only run over numeric columns, unless the
|
|
|
87
87
|
`--wildcard-include-string-len` or `--wildcard-include-timestamp` flags are present.
|
|
88
88
|
|
|
89
89
|
```
|
|
90
|
-
data-validation
|
|
90
|
+
data-validation
|
|
91
|
+
[--verbose or -v ]
|
|
92
|
+
Verbose logging
|
|
93
|
+
[--log-level or -ll]
|
|
94
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
95
|
+
validate column
|
|
91
96
|
--source-conn or -sc SOURCE_CONN
|
|
92
97
|
Source connection details
|
|
93
98
|
See: *Data Source Configurations* section for each data source
|
|
@@ -95,7 +100,7 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
95
100
|
Target connection details
|
|
96
101
|
See: *Connections* section for each data source
|
|
97
102
|
--tables-list or -tbls SOURCE_SCHEMA.SOURCE_TABLE=TARGET_SCHEMA.TARGET_TABLE
|
|
98
|
-
Comma separated list of tables in the form schema.table=target_schema.target_table
|
|
103
|
+
Comma separated list of tables in the form schema.table=target_schema.target_table. Or shorthand schema.* for all tables.
|
|
99
104
|
Target schema name and table name are optional.
|
|
100
105
|
i.e 'bigquery-public-data.new_york_citibike.citibike_trips'
|
|
101
106
|
[--grouped-columns or -gc GROUPED_COLUMNS]
|
|
@@ -136,6 +141,7 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
136
141
|
Format for stdout output. Supported formats are (text, csv, json, table). Defaults to table.
|
|
137
142
|
[--filter-status or -fs STATUSES_LIST]
|
|
138
143
|
Comma separated list of statuses to filter the validation results. Supported statuses are (success, fail). If no list is provided, all statuses are returned.
|
|
144
|
+
|
|
139
145
|
```
|
|
140
146
|
|
|
141
147
|
The default aggregation type is a 'COUNT *', which will run in addition to the validations you specify. To remove this default,
|
|
@@ -166,7 +172,12 @@ Under the hood, row validation uses
|
|
|
166
172
|
apply functions such as IFNULL() or RTRIM(). These can be edited in the YAML or JSON config file to customize your row validation.
|
|
167
173
|
|
|
168
174
|
```
|
|
169
|
-
data-validation
|
|
175
|
+
data-validation
|
|
176
|
+
[--verbose or -v ]
|
|
177
|
+
Verbose logging
|
|
178
|
+
[--log-level or -ll]
|
|
179
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
180
|
+
validate row
|
|
170
181
|
--source-conn or -sc SOURCE_CONN
|
|
171
182
|
Source connection details
|
|
172
183
|
See: *Data Source Configurations* section for each data source
|
|
@@ -224,8 +235,12 @@ The command generates and stores multiple YAML validations each representing a c
|
|
|
224
235
|
The command takes the same parameters as required for `Row Validation` *plus* a few parameters to support partitioning. Single and multiple primary keys are supported and keys can be of any indexable type, except for date and timestamp type. A parameter used in earlier versions, ```partition-key``` is no longer supported.
|
|
225
236
|
|
|
226
237
|
```
|
|
227
|
-
data-validation
|
|
228
|
-
|
|
238
|
+
data-validation
|
|
239
|
+
[--verbose or -v ]
|
|
240
|
+
Verbose logging
|
|
241
|
+
[--log-level or -ll]
|
|
242
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
243
|
+
generate-table-partitions
|
|
229
244
|
--source-conn or -sc SOURCE_CONN
|
|
230
245
|
Source connection details
|
|
231
246
|
See: *Data Source Configurations* section for each data source
|
|
@@ -247,7 +262,7 @@ data-validation (--verbose or -v) (--log-level or -ll) generate-table-partitions
|
|
|
247
262
|
Directory Path to store YAML Config Files
|
|
248
263
|
GCS: Provide a full gs:// path of the target directory. Eg: `gs://<BUCKET>/partitions_dir`
|
|
249
264
|
Local: Provide a relative path of the target directory. Eg: `partitions_dir`
|
|
250
|
-
--partition-num INT, -pn INT
|
|
265
|
+
--partition-num INT, -pn INT
|
|
251
266
|
Number of partitions into which the table should be split, e.g. 1000 or 10000
|
|
252
267
|
In case this value exceeds the row count of the source/target table, it will be decreased to max(source_row_count, target_row_count)
|
|
253
268
|
[--bq-result-handler or -bqrh PROJECT_ID.DATASET.TABLE]
|
|
@@ -255,7 +270,7 @@ data-validation (--verbose or -v) (--log-level or -ll) generate-table-partitions
|
|
|
255
270
|
See: *Validation Reports* section
|
|
256
271
|
[--service-account or -sa PATH_TO_SA_KEY]
|
|
257
272
|
Service account to use for BigQuery result handler output.
|
|
258
|
-
[--parts-per-file INT], [-ppf INT]
|
|
273
|
+
[--parts-per-file INT], [-ppf INT]
|
|
259
274
|
Number of partitions in a yaml file, default value 1.
|
|
260
275
|
[--filters SOURCE_FILTER:TARGET_FILTER]
|
|
261
276
|
Colon separated string values of source and target filters.
|
|
@@ -280,7 +295,12 @@ types between source and target.
|
|
|
280
295
|
Note: An exclamation point before a data type (`!string`) signifies the column is non-nullable or required.
|
|
281
296
|
|
|
282
297
|
```
|
|
283
|
-
data-validation
|
|
298
|
+
data-validation
|
|
299
|
+
[--verbose or -v ]
|
|
300
|
+
Verbose logging
|
|
301
|
+
[--log-level or -ll]
|
|
302
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
303
|
+
validate schema
|
|
284
304
|
--source-conn or -sc SOURCE_CONN
|
|
285
305
|
Source connection details
|
|
286
306
|
See: *Data Source Configurations* section for each data source
|
|
@@ -288,7 +308,7 @@ data-validation (--verbose or -v) (--log-level or -ll) validate schema
|
|
|
288
308
|
Target connection details
|
|
289
309
|
See: *Connections* section for each data source
|
|
290
310
|
--tables-list or -tbls SOURCE_SCHEMA.SOURCE_TABLE=TARGET_SCHEMA.TARGET_TABLE
|
|
291
|
-
Comma separated list of tables in the form schema.table=target_schema.target_table
|
|
311
|
+
Comma separated list of tables in the form schema.table=target_schema.target_table. Or shorthand schema.* for all tables.
|
|
292
312
|
Target schema name and table name are optional.
|
|
293
313
|
e.g.: 'bigquery-public-data.new_york_citibike.citibike_trips'
|
|
294
314
|
[--bq-result-handler or -bqrh PROJECT_ID.DATASET.TABLE]
|
|
@@ -321,7 +341,12 @@ data-validation (--verbose or -v) (--log-level or -ll) validate schema
|
|
|
321
341
|
Below is the command syntax for custom query column validations.
|
|
322
342
|
|
|
323
343
|
```
|
|
324
|
-
data-validation
|
|
344
|
+
data-validation
|
|
345
|
+
[--verbose or -v ]
|
|
346
|
+
Verbose logging
|
|
347
|
+
[--log-level or -ll]
|
|
348
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
349
|
+
validate custom-query column
|
|
325
350
|
--source-conn or -sc SOURCE_CONN
|
|
326
351
|
Source connection details
|
|
327
352
|
See: *Data Source Configurations* section for each data source
|
|
@@ -383,7 +408,12 @@ in the SELECT statement of both source_query.sql and target_query.sql. See *Pri
|
|
|
383
408
|
Below is the command syntax for custom query row validations.
|
|
384
409
|
|
|
385
410
|
```
|
|
386
|
-
data-validation
|
|
411
|
+
data-validation
|
|
412
|
+
[--verbose or -v ]
|
|
413
|
+
Verbose logging
|
|
414
|
+
[--log-level or -ll]
|
|
415
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
416
|
+
validate custom-query row
|
|
387
417
|
--source-conn or -sc SOURCE_CONN
|
|
388
418
|
Source connection details
|
|
389
419
|
See: *Data Source Configurations* section for each data source
|
|
@@ -441,7 +471,12 @@ The `validate` command takes a `--dry-run` command line flag that prints source
|
|
|
441
471
|
and target SQL to stdout as JSON in lieu of performing a validation:
|
|
442
472
|
|
|
443
473
|
```
|
|
444
|
-
data-validation
|
|
474
|
+
data-validation
|
|
475
|
+
[--verbose or -v ]
|
|
476
|
+
Verbose logging
|
|
477
|
+
[--log-level or -ll]
|
|
478
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
479
|
+
validate
|
|
445
480
|
[--dry-run or -dr] Prints source and target SQL to stdout in lieu of performing a validation.
|
|
446
481
|
```
|
|
447
482
|
|
|
@@ -472,7 +507,12 @@ GCS and local paths.
|
|
|
472
507
|
You can use the `data-validation configs` command to run and view YAMLs.
|
|
473
508
|
|
|
474
509
|
```
|
|
475
|
-
data-validation
|
|
510
|
+
data-validation
|
|
511
|
+
[--verbose or -v ]
|
|
512
|
+
Verbose logging
|
|
513
|
+
[--log-level or -ll]
|
|
514
|
+
Log Level to be assigned. Supported levels are (DEBUG,INFO,WARNING,ERROR,CRITICAL). Defaults to INFO.
|
|
515
|
+
configs run
|
|
476
516
|
[--config-file or -c CONFIG_FILE]
|
|
477
517
|
Path to YAML config file to run. Supports local and GCS paths.
|
|
478
518
|
[--config-dir or -cdir CONFIG_DIR]
|
{google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/__main__.py
RENAMED
|
@@ -24,11 +24,11 @@ from data_validation import (
|
|
|
24
24
|
cli_tools,
|
|
25
25
|
clients,
|
|
26
26
|
consts,
|
|
27
|
-
jellyfish_distance,
|
|
28
27
|
state_manager,
|
|
29
28
|
)
|
|
30
29
|
from data_validation.config_manager import ConfigManager
|
|
31
30
|
from data_validation.data_validation import DataValidation
|
|
31
|
+
from data_validation.find_tables import find_tables_using_string_matching
|
|
32
32
|
from data_validation.partition_builder import PartitionBuilder
|
|
33
33
|
|
|
34
34
|
# by default yaml dumps lists as pointers. This disables that feature
|
|
@@ -434,71 +434,6 @@ def build_config_managers_from_yaml(args, config_file_path):
|
|
|
434
434
|
return config_managers
|
|
435
435
|
|
|
436
436
|
|
|
437
|
-
def _compare_match_tables(source_table_map, target_table_map, score_cutoff=0.8):
|
|
438
|
-
"""Return dict config object from matching tables."""
|
|
439
|
-
# TODO(dhercher): evaluate if improved comparison and score cutoffs should be used.
|
|
440
|
-
table_configs = []
|
|
441
|
-
|
|
442
|
-
target_keys = target_table_map.keys()
|
|
443
|
-
for source_key in source_table_map:
|
|
444
|
-
target_key = jellyfish_distance.extract_closest_match(
|
|
445
|
-
source_key, target_keys, score_cutoff=score_cutoff
|
|
446
|
-
)
|
|
447
|
-
if target_key is None:
|
|
448
|
-
continue
|
|
449
|
-
|
|
450
|
-
table_config = {
|
|
451
|
-
consts.CONFIG_SCHEMA_NAME: source_table_map[source_key][
|
|
452
|
-
consts.CONFIG_SCHEMA_NAME
|
|
453
|
-
],
|
|
454
|
-
consts.CONFIG_TABLE_NAME: source_table_map[source_key][
|
|
455
|
-
consts.CONFIG_TABLE_NAME
|
|
456
|
-
],
|
|
457
|
-
consts.CONFIG_TARGET_SCHEMA_NAME: target_table_map[target_key][
|
|
458
|
-
consts.CONFIG_SCHEMA_NAME
|
|
459
|
-
],
|
|
460
|
-
consts.CONFIG_TARGET_TABLE_NAME: target_table_map[target_key][
|
|
461
|
-
consts.CONFIG_TABLE_NAME
|
|
462
|
-
],
|
|
463
|
-
}
|
|
464
|
-
table_configs.append(table_config)
|
|
465
|
-
|
|
466
|
-
return table_configs
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
def get_table_map(client, allowed_schemas=None):
|
|
470
|
-
"""Return dict with searchable keys for table matching."""
|
|
471
|
-
table_map = {}
|
|
472
|
-
table_objs = clients.get_all_tables(client, allowed_schemas=allowed_schemas)
|
|
473
|
-
|
|
474
|
-
for table_obj in table_objs:
|
|
475
|
-
table_key = ".".join([t for t in table_obj if t])
|
|
476
|
-
table_map[table_key] = {
|
|
477
|
-
consts.CONFIG_SCHEMA_NAME: table_obj[0],
|
|
478
|
-
consts.CONFIG_TABLE_NAME: table_obj[1],
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
return table_map
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
def find_tables_using_string_matching(args):
|
|
485
|
-
"""Return JSON String with matched tables for use in validations."""
|
|
486
|
-
score_cutoff = args.score_cutoff or 1
|
|
487
|
-
|
|
488
|
-
mgr = state_manager.StateManager()
|
|
489
|
-
source_client = clients.get_data_client(mgr.get_connection_config(args.source_conn))
|
|
490
|
-
target_client = clients.get_data_client(mgr.get_connection_config(args.target_conn))
|
|
491
|
-
|
|
492
|
-
allowed_schemas = cli_tools.get_arg_list(args.allowed_schemas)
|
|
493
|
-
source_table_map = get_table_map(source_client, allowed_schemas=allowed_schemas)
|
|
494
|
-
target_table_map = get_table_map(target_client)
|
|
495
|
-
|
|
496
|
-
table_configs = _compare_match_tables(
|
|
497
|
-
source_table_map, target_table_map, score_cutoff=score_cutoff
|
|
498
|
-
)
|
|
499
|
-
return json.dumps(table_configs)
|
|
500
|
-
|
|
501
|
-
|
|
502
437
|
def run_raw_query_against_connection(args):
|
|
503
438
|
"""Return results of raw query for ad hoc usage."""
|
|
504
439
|
mgr = state_manager.StateManager()
|
{google_pso_data_validator-6.1.0 → google_pso_data_validator-6.2.0}/data_validation/cli_tools.py
RENAMED
|
@@ -52,13 +52,15 @@ import sys
|
|
|
52
52
|
import uuid
|
|
53
53
|
import os
|
|
54
54
|
import math
|
|
55
|
+
import re
|
|
55
56
|
from argparse import Namespace
|
|
56
57
|
from typing import Dict, List, Optional
|
|
57
58
|
from yaml import Dumper, Loader, dump, load
|
|
58
59
|
|
|
59
|
-
from data_validation import clients, consts, state_manager, gcs_helper
|
|
60
|
+
from data_validation import clients, consts, find_tables, state_manager, gcs_helper
|
|
60
61
|
from data_validation.validation_builder import list_to_sublists
|
|
61
62
|
|
|
63
|
+
|
|
62
64
|
CONNECTION_SOURCE_FIELDS = {
|
|
63
65
|
"BigQuery": [
|
|
64
66
|
["project_id", "GCP Project to use for BigQuery"],
|
|
@@ -645,7 +647,7 @@ def _configure_column_parser(column_parser):
|
|
|
645
647
|
"-tbls",
|
|
646
648
|
default=None,
|
|
647
649
|
required=True,
|
|
648
|
-
help="Comma separated tables list in the form 'schema.table=target_schema.target_table'",
|
|
650
|
+
help="Comma separated tables list in the form 'schema.table=target_schema.target_table'. Or shorthand schema.* for all tables.",
|
|
649
651
|
)
|
|
650
652
|
_add_common_arguments(optional_arguments, required_arguments)
|
|
651
653
|
|
|
@@ -1064,26 +1066,33 @@ def get_labels(arg_labels):
|
|
|
1064
1066
|
return labels
|
|
1065
1067
|
|
|
1066
1068
|
|
|
1067
|
-
def get_filters(filter_value):
|
|
1068
|
-
"""Returns
|
|
1069
|
-
|
|
1070
|
-
|
|
1069
|
+
def get_filters(filter_value: str) -> List[Dict]:
|
|
1070
|
+
"""Returns filters for source and target from --filters argument.
|
|
1071
|
+
A filter is the condition that is used in a SQL WHERE clause.
|
|
1072
|
+
If only one filter is specified, it applies to both source and target
|
|
1073
|
+
For a doc on regular expression for filters see docs/internal/filters_regex.md
|
|
1071
1074
|
"""
|
|
1075
|
+
|
|
1076
|
+
single_filter = r"([^':]*('[^']*')*)*"
|
|
1077
|
+
double_filter = (
|
|
1078
|
+
r"(?P<source>" + single_filter + r"):(?P<target>" + single_filter + r")"
|
|
1079
|
+
)
|
|
1072
1080
|
filter_config = []
|
|
1073
|
-
|
|
1074
|
-
|
|
1081
|
+
if result := re.fullmatch(single_filter, filter_value):
|
|
1082
|
+
if result.group(0) == "":
|
|
1083
|
+
raise ValueError("Empty string not allowed in filter")
|
|
1075
1084
|
filter_dict = {
|
|
1076
1085
|
"type": "custom",
|
|
1077
|
-
"source":
|
|
1078
|
-
"target":
|
|
1086
|
+
"source": result.group(0),
|
|
1087
|
+
"target": result.group(0),
|
|
1079
1088
|
}
|
|
1080
|
-
elif
|
|
1081
|
-
if
|
|
1082
|
-
raise ValueError("
|
|
1089
|
+
elif result := re.fullmatch(double_filter, filter_value):
|
|
1090
|
+
if result.group("source") == "" or result.group("target") == "":
|
|
1091
|
+
raise ValueError("Empty string not allowed in filter")
|
|
1083
1092
|
filter_dict = {
|
|
1084
1093
|
"type": "custom",
|
|
1085
|
-
"source":
|
|
1086
|
-
"target":
|
|
1094
|
+
"source": result.group("source"),
|
|
1095
|
+
"target": result.group("target"),
|
|
1087
1096
|
}
|
|
1088
1097
|
else:
|
|
1089
1098
|
raise ValueError("Unable to parse filter arguments.")
|
|
@@ -1151,7 +1160,7 @@ def get_tables_list(arg_tables, default_value=None, is_filesystem=False):
|
|
|
1151
1160
|
|
|
1152
1161
|
tables_list = []
|
|
1153
1162
|
tables_mapping = list(csv.reader([arg_tables]))[0]
|
|
1154
|
-
source_schema_required =
|
|
1163
|
+
source_schema_required = bool(not is_filesystem)
|
|
1155
1164
|
|
|
1156
1165
|
for mapping in tables_mapping:
|
|
1157
1166
|
tables_map = mapping.split("=")
|
|
@@ -1388,6 +1397,10 @@ def get_pre_build_configs(args: Namespace, validate_cmd: str) -> List[Dict]:
|
|
|
1388
1397
|
filter_status = None
|
|
1389
1398
|
|
|
1390
1399
|
pre_build_configs_list = []
|
|
1400
|
+
if config_type != consts.CUSTOM_QUERY:
|
|
1401
|
+
tables_list = find_tables.expand_tables_of_asterisk(
|
|
1402
|
+
tables_list, source_client, target_client
|
|
1403
|
+
)
|
|
1391
1404
|
for table_obj in tables_list:
|
|
1392
1405
|
pre_build_configs = {
|
|
1393
1406
|
"config_type": config_type,
|