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.
Files changed (47) hide show
  1. {table_validator-0.1.0/table_validator.egg-info → table_validator-0.1.1}/PKG-INFO +1 -1
  2. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/main.py +29 -6
  3. {table_validator-0.1.0 → table_validator-0.1.1/table_validator.egg-info}/PKG-INFO +1 -1
  4. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/scm_version.json +2 -2
  5. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_cli.py +30 -0
  6. {table_validator-0.1.0 → table_validator-0.1.1}/LICENSE +0 -0
  7. {table_validator-0.1.0 → table_validator-0.1.1}/README.md +0 -0
  8. {table_validator-0.1.0 → table_validator-0.1.1}/pyproject.toml +0 -0
  9. {table_validator-0.1.0 → table_validator-0.1.1}/setup.cfg +0 -0
  10. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/__init__.py +0 -0
  11. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/auth/__init__.py +0 -0
  12. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/auth/azure_auth.py +0 -0
  13. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/auth/databricks_auth.py +0 -0
  14. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/__init__.py +0 -0
  15. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/partition_prompt.py +0 -0
  16. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/summary_table.py +0 -0
  17. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/cli/wizard.py +0 -0
  18. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/config/__init__.py +0 -0
  19. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/config/manager.py +0 -0
  20. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/config/schema.py +0 -0
  21. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/connectors/__init__.py +0 -0
  22. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/connectors/azure_connector.py +0 -0
  23. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/connectors/databricks_connector.py +0 -0
  24. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/engine/__init__.py +0 -0
  25. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/engine/comparison_engine.py +0 -0
  26. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/models.py +0 -0
  27. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/reports/__init__.py +0 -0
  28. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/reports/excel_report.py +0 -0
  29. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/__init__.py +0 -0
  30. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/blob_discovery.py +0 -0
  31. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/catalog_validator.py +0 -0
  32. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator/validators/row_validator.py +0 -0
  33. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/SOURCES.txt +0 -0
  34. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/dependency_links.txt +0 -0
  35. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/entry_points.txt +0 -0
  36. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/requires.txt +0 -0
  37. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/scm_file_list.json +0 -0
  38. {table_validator-0.1.0 → table_validator-0.1.1}/table_validator.egg-info/top_level.txt +0 -0
  39. {table_validator-0.1.0 → table_validator-0.1.1}/tests/__init__.py +0 -0
  40. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_blob_discovery.py +0 -0
  41. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_catalog_validator.py +0 -0
  42. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_databricks_connector.py +0 -0
  43. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_excel_report.py +0 -0
  44. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_partition_prompt.py +0 -0
  45. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_report_command.py +0 -0
  46. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_row_validator.py +0 -0
  47. {table_validator-0.1.0 → table_validator-0.1.1}/tests/test_wizard.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: table-validator
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: CLI tool for validating data migrations between Azure (Blob Storage / SQL Database) and Databricks Delta Lake catalogs
5
5
  License: MIT
6
6
  Requires-Python: >=3.9
@@ -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
- generate_excel_report(
296
- result, str(output),
297
- source_type=config.source_type.value,
298
- enabled_validations=report_enabled_validations,
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: table-validator
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: CLI tool for validating data migrations between Azure (Blob Storage / SQL Database) and Databricks Delta Lake catalogs
5
5
  License: MIT
6
6
  Requires-Python: >=3.9
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "0.1.0",
2
+ "tag": "0.1.1",
3
3
  "distance": 0,
4
- "node": "gaeb6df763293e80acabcfa9ac9c4d5e4a2f2e8f1",
4
+ "node": "gd0c901c9dfc750527e33620c5dea6b15e43e4443",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-08-27"
@@ -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