table-validator 0.1.4__tar.gz → 0.1.5__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.4/table_validator.egg-info → table_validator-0.1.5}/PKG-INFO +1 -1
  2. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/validators/catalog_validator.py +24 -0
  3. {table_validator-0.1.4 → table_validator-0.1.5/table_validator.egg-info}/PKG-INFO +1 -1
  4. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator.egg-info/scm_version.json +2 -2
  5. {table_validator-0.1.4 → table_validator-0.1.5}/tests/test_catalog_validator.py +30 -0
  6. {table_validator-0.1.4 → table_validator-0.1.5}/LICENSE +0 -0
  7. {table_validator-0.1.4 → table_validator-0.1.5}/README.md +0 -0
  8. {table_validator-0.1.4 → table_validator-0.1.5}/pyproject.toml +0 -0
  9. {table_validator-0.1.4 → table_validator-0.1.5}/setup.cfg +0 -0
  10. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/__init__.py +0 -0
  11. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/auth/__init__.py +0 -0
  12. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/auth/azure_auth.py +0 -0
  13. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/auth/databricks_auth.py +0 -0
  14. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/cli/__init__.py +0 -0
  15. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/cli/main.py +0 -0
  16. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/cli/partition_prompt.py +0 -0
  17. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/cli/summary_table.py +0 -0
  18. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/cli/wizard.py +0 -0
  19. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/config/__init__.py +0 -0
  20. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/config/manager.py +0 -0
  21. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/config/schema.py +0 -0
  22. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/connectors/__init__.py +0 -0
  23. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/connectors/azure_connector.py +0 -0
  24. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/connectors/databricks_connector.py +0 -0
  25. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/engine/__init__.py +0 -0
  26. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/engine/comparison_engine.py +0 -0
  27. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/models.py +0 -0
  28. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/reports/__init__.py +0 -0
  29. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/reports/excel_report.py +0 -0
  30. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/validators/__init__.py +0 -0
  31. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/validators/blob_discovery.py +0 -0
  32. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator/validators/row_validator.py +0 -0
  33. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator.egg-info/SOURCES.txt +0 -0
  34. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator.egg-info/dependency_links.txt +0 -0
  35. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator.egg-info/entry_points.txt +0 -0
  36. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator.egg-info/requires.txt +0 -0
  37. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator.egg-info/scm_file_list.json +0 -0
  38. {table_validator-0.1.4 → table_validator-0.1.5}/table_validator.egg-info/top_level.txt +0 -0
  39. {table_validator-0.1.4 → table_validator-0.1.5}/tests/__init__.py +0 -0
  40. {table_validator-0.1.4 → table_validator-0.1.5}/tests/test_blob_discovery.py +0 -0
  41. {table_validator-0.1.4 → table_validator-0.1.5}/tests/test_cli.py +0 -0
  42. {table_validator-0.1.4 → table_validator-0.1.5}/tests/test_databricks_connector.py +0 -0
  43. {table_validator-0.1.4 → table_validator-0.1.5}/tests/test_excel_report.py +0 -0
  44. {table_validator-0.1.4 → table_validator-0.1.5}/tests/test_partition_prompt.py +0 -0
  45. {table_validator-0.1.4 → table_validator-0.1.5}/tests/test_report_command.py +0 -0
  46. {table_validator-0.1.4 → table_validator-0.1.5}/tests/test_row_validator.py +0 -0
  47. {table_validator-0.1.4 → table_validator-0.1.5}/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.4
3
+ Version: 0.1.5
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
@@ -398,6 +398,18 @@ class CatalogValidator:
398
398
  if pair_key in existing_pairs_lower:
399
399
  continue
400
400
 
401
+ # An explicit mapping for this source schema supersedes any
402
+ # identical-name pair already seeded for it (e.g. a
403
+ # coincidental same-named schema on both sides) - the user
404
+ # named exactly one target for this source schema, so it must
405
+ # be validated once, against that target, not once against
406
+ # its own identical-name match AND again against the mapped
407
+ # target.
408
+ common_pairs = [
409
+ (s, t) for s, t in common_pairs if s.lower() != actual_source.lower()
410
+ ]
411
+ existing_pairs_lower = {(s.lower(), t.lower()) for s, t in common_pairs}
412
+
401
413
  common_pairs.append((actual_source, actual_target))
402
414
  existing_pairs_lower.add(pair_key)
403
415
  missing_set.discard(actual_source)
@@ -586,6 +598,18 @@ class CatalogValidator:
586
598
  if pair_key in existing_pairs_lower:
587
599
  continue
588
600
 
601
+ # An explicit mapping for this source table supersedes any
602
+ # identical-name pair already seeded for it (e.g. a
603
+ # coincidental same-named table on both sides) - the user
604
+ # named exactly one target for this source table, so it must
605
+ # be validated once, against that target, not once against
606
+ # its own identical-name match AND again against the mapped
607
+ # target.
608
+ common_pairs = [
609
+ (s, t) for s, t in common_pairs if s.lower() != actual_source.lower()
610
+ ]
611
+ existing_pairs_lower = {(s.lower(), t.lower()) for s, t in common_pairs}
612
+
589
613
  common_pairs.append((actual_source, actual_target))
590
614
  existing_pairs_lower.add(pair_key)
591
615
  missing_set.discard(actual_source)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: table-validator
3
- Version: 0.1.4
3
+ Version: 0.1.5
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.4",
2
+ "tag": "0.1.5",
3
3
  "distance": 0,
4
- "node": "gb4d33e041e4eaea0e6645d64709a7fe7142c76db",
4
+ "node": "g343999ed2ff4c4d7ddf8d0ddcd3cc0ced0df29b2",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-08-28"
@@ -1473,6 +1473,36 @@ def test_table_map_validates_explicit_pair_with_different_names():
1473
1473
  connector.get_row_count.assert_called()
1474
1474
 
1475
1475
 
1476
+ def test_table_map_source_name_existing_identically_on_target_is_not_validated_twice():
1477
+ """Real bug: the source table ('jd_example_data_2') coincidentally also
1478
+ exists under that exact same name on the target side (an unrelated
1479
+ leftover table), so compare_tables' plain intersection legitimately
1480
+ finds an identical-name pair for it - in ADDITION to the table_map
1481
+ entry pairing it with a different target ('jd_example_data_90'). The
1482
+ mapping must supersede the identical-name match, not run alongside
1483
+ it: one source table configured by the user must produce exactly one
1484
+ validated table, against the mapped target only."""
1485
+ connector = _make_connector()
1486
+ connector.get_tables.side_effect = lambda catalog, schema: (
1487
+ ["jd_example_data_2"] if catalog == "cat_source"
1488
+ else ["jd_example_data_2", "jd_example_data_90"]
1489
+ )
1490
+ validator = CatalogValidator(connector)
1491
+
1492
+ result = validator.compare_catalogs(
1493
+ _request(
1494
+ tables=["jd_example_data_2"],
1495
+ table_map={"jd_example_data_2": "jd_example_data_90"},
1496
+ )
1497
+ )
1498
+
1499
+ schema_result = result.schemas[0]
1500
+ assert len(schema_result.tables) == 1
1501
+ table = schema_result.tables[0]
1502
+ assert table.table == "jd_example_data_90"
1503
+ assert table.source_table_name == "jd_example_data_2"
1504
+
1505
+
1476
1506
  def test_table_map_to_nonexistent_target_table_produces_clear_error():
1477
1507
  """A table_map entry naming a target table that does NOT exist must
1478
1508
  produce a visible FAIL/ERROR with an informative message - never a
File without changes