table-validator 0.1.0__tar.gz → 0.1.1__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.
- {table_validator-0.1.0/table_validator.egg-info → table_validator-0.1.1}/PKG-INFO +1 -1
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/main.py +29 -6
- {table_validator-0.1.0 → table_validator-0.1.1/table_validator.egg-info}/PKG-INFO +1 -1
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/scm_version.json +2 -2
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_cli.py +30 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/LICENSE +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/README.md +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/pyproject.toml +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/setup.cfg +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/auth/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/auth/azure_auth.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/auth/databricks_auth.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/partition_prompt.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/summary_table.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/wizard.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/config/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/config/manager.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/config/schema.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/connectors/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/connectors/azure_connector.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/connectors/databricks_connector.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/engine/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/engine/comparison_engine.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/models.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/reports/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/reports/excel_report.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/blob_discovery.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/catalog_validator.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/row_validator.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/SOURCES.txt +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/dependency_links.txt +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/entry_points.txt +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/requires.txt +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/scm_file_list.json +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/top_level.txt +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/__init__.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_blob_discovery.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_catalog_validator.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_databricks_connector.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_excel_report.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_partition_prompt.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_report_command.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_row_validator.py +0 -0
- {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_wizard.py +0 -0
|
@@ -63,6 +63,14 @@ def _configure_logging(verbose: bool, quiet: bool) -> None:
|
|
|
63
63
|
logger = logging.getLogger("table_validator")
|
|
64
64
|
logger.propagate = False
|
|
65
65
|
|
|
66
|
+
# Each CLI invocation must start with a clean handler set: leftover
|
|
67
|
+
# handlers from a previous invocation in the same process (e.g. every
|
|
68
|
+
# test in this suite drives the CLI through the same interpreter) can
|
|
69
|
+
# point at an already-closed/detached stream, causing "Logging error"
|
|
70
|
+
# noise on emit rather than the intended output.
|
|
71
|
+
for old_handler in list(logger.handlers):
|
|
72
|
+
logger.removeHandler(old_handler)
|
|
73
|
+
|
|
66
74
|
if quiet:
|
|
67
75
|
# No handler at all (not even a raised level) - otherwise Python's
|
|
68
76
|
# logging module falls back to its own stderr "lastResort" handler
|
|
@@ -124,6 +132,9 @@ def info() -> None:
|
|
|
124
132
|
" Runs the comparison using the saved configuration and "
|
|
125
133
|
"writes an Excel report (validation_report.xlsx by default). "
|
|
126
134
|
"Prints a pass/fail summary in the terminal when it finishes.\n"
|
|
135
|
+
" To write to a different file instead of overwriting the "
|
|
136
|
+
"default (e.g. if it's still open in Excel from a previous run):\n"
|
|
137
|
+
" tablevalidator validate --output validation_report_new.xlsx\n"
|
|
127
138
|
"\n"
|
|
128
139
|
" 3. tablevalidator open\n"
|
|
129
140
|
" Opens the most recently generated report in your default "
|
|
@@ -135,7 +146,9 @@ def info() -> None:
|
|
|
135
146
|
"existing report without opening it.\n"
|
|
136
147
|
"\n"
|
|
137
148
|
"Run 'tablevalidator <command> --help' for a command's full "
|
|
138
|
-
"options (e.g. tablevalidator validate --help)
|
|
149
|
+
"options (e.g. tablevalidator validate --help).\n"
|
|
150
|
+
"\n"
|
|
151
|
+
"TO KEERTHIVASAN"
|
|
139
152
|
)
|
|
140
153
|
|
|
141
154
|
|
|
@@ -292,11 +305,21 @@ def validate(
|
|
|
292
305
|
if config.source_type == SourceType.DATABRICKS
|
|
293
306
|
else None
|
|
294
307
|
)
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
308
|
+
try:
|
|
309
|
+
generate_excel_report(
|
|
310
|
+
result, str(output),
|
|
311
|
+
source_type=config.source_type.value,
|
|
312
|
+
enabled_validations=report_enabled_validations,
|
|
313
|
+
)
|
|
314
|
+
except PermissionError:
|
|
315
|
+
typer.secho(
|
|
316
|
+
f"Could not write '{output}' - the file is open in Excel (or "
|
|
317
|
+
"another program) and locked for writing. Close it and re-run "
|
|
318
|
+
"'tablevalidator validate', or pass a different path with "
|
|
319
|
+
"--output.",
|
|
320
|
+
fg=typer.colors.RED,
|
|
321
|
+
)
|
|
322
|
+
raise typer.Exit(code=1)
|
|
300
323
|
|
|
301
324
|
# ------------------------------------------------------------------
|
|
302
325
|
# 8. Print a summary - per-table PASS/FAIL lines, then the same
|
|
@@ -297,6 +297,36 @@ def test_open_command_errors_cleanly_when_report_missing(tmp_path: Path, _never_
|
|
|
297
297
|
_never_launch_a_real_app.assert_not_called()
|
|
298
298
|
|
|
299
299
|
|
|
300
|
+
def test_validate_locked_report_file_errors_cleanly_not_traceback(tmp_path: Path) -> None:
|
|
301
|
+
config_path = _full_config(tmp_path)
|
|
302
|
+
output_path = tmp_path / "validation_report.xlsx"
|
|
303
|
+
mock_connector = _mock_databricks_connector()
|
|
304
|
+
|
|
305
|
+
with patch(
|
|
306
|
+
"table_validator.cli.main.DatabricksConnector", return_value=mock_connector
|
|
307
|
+
), patch(
|
|
308
|
+
"table_validator.cli.main.get_databricks_token", return_value="dapi_fake"
|
|
309
|
+
), patch(
|
|
310
|
+
"table_validator.cli.main.get_azure_credential", return_value=None
|
|
311
|
+
), patch(
|
|
312
|
+
"table_validator.cli.main.generate_excel_report",
|
|
313
|
+
side_effect=PermissionError(13, "Permission denied"),
|
|
314
|
+
):
|
|
315
|
+
result = runner.invoke(
|
|
316
|
+
app,
|
|
317
|
+
[
|
|
318
|
+
"validate",
|
|
319
|
+
"--config-path", str(config_path),
|
|
320
|
+
"--output", str(output_path),
|
|
321
|
+
],
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
assert result.exit_code == 1
|
|
325
|
+
assert "open in Excel" in result.output
|
|
326
|
+
assert "--output" in result.output
|
|
327
|
+
assert "Traceback" not in result.output
|
|
328
|
+
|
|
329
|
+
|
|
300
330
|
def test_validate_exits_nonzero_on_failed_validation(tmp_path: Path) -> None:
|
|
301
331
|
config_path = _full_config(tmp_path)
|
|
302
332
|
output_path = tmp_path / "validation_report.xlsx"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{table_validator-0.1.0 → table_validator-0.1.1}/table_validator/connectors/azure_connector.py
RENAMED
|
File without changes
|
{table_validator-0.1.0 → table_validator-0.1.1}/table_validator/connectors/databricks_connector.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/blob_discovery.py
RENAMED
|
File without changes
|
{table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/catalog_validator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|