Skip to content

Fix reconcile notebook docs: update TableRecon API for v2#2327

Closed
moomindani wants to merge 1 commit intodatabrickslabs:mainfrom
moomindani:fix/2232-tablerecon-source-schema
Closed

Fix reconcile notebook docs: update TableRecon API for v2#2327
moomindani wants to merge 1 commit intodatabrickslabs:mainfrom
moomindani:fix/2232-tablerecon-source-schema

Conversation

@moomindani
Copy link

Summary

Fixes #2232.

Users following the Running Reconcile on Notebook guide hit this error immediately:

TypeError: TableRecon.__init__() got an unexpected keyword argument 'source_schema'

Root cause

TableRecon was refactored in v2 (PR #2150) to remove the schema/catalog fields — source_schema, target_catalog, target_schema, source_catalog — which moved to DatabaseConfig inside ReconcileConfig. A v1_migrate() method was added to handle old YAML config files, but the notebook documentation was never updated, so users copy-pasting the examples get an immediate crash.

Changes

recon_notebook.mdx

  • Update the TableRecon dataclass signature to show only tables: list[Table] (the current v2 API)
  • Remove the old schema fields (source_schema, target_catalog, target_schema) from the TableRecon(...) usage example
  • Add a :::note callout explaining the migration so users upgrading from v1 understand what changed and where to put those values now

reconcile_configuration.mdx

  • Fix a secondary bug: the drop_columns example was shown inside TableRecon(...) but drop_columns is actually a field on Table, not TableRecon

Before / After

Before (causes crash):

table_recon = TableRecon(
    source_schema="source_sf_schema",        # ← does not exist in v2
    target_catalog="target_databricks_catalog",  # ← does not exist in v2
    target_schema="target_databricks_schema",    # ← does not exist in v2
    tables=[...]
)

After (correct v2 API):

# Schema/catalog go in ReconcileConfig → DatabaseConfig
reconcile_config = ReconcileConfig(
    ...
    database_config=DatabaseConfig(
        source_schema="source_sf_schema",
        target_catalog="target_databricks_catalog",
        target_schema="target_databricks_schema",
    ),
)

# TableRecon only holds the table list
table_recon = TableRecon(tables=[...])

🤖 Generated with Claude Code

…labs#2232)

TableRecon was refactored in v2 to remove source_schema, target_catalog,
target_schema, and source_catalog fields. These are now configured via
DatabaseConfig inside ReconcileConfig. The notebook documentation still
showed the old v1 signature, causing `TypeError: TableRecon.__init__() got
an unexpected keyword argument 'source_schema'` for users following the guide.

- Update TableRecon dataclass signature in recon_notebook.mdx to show only
  `tables: list[Table]`
- Remove old schema fields from the TableRecon usage example
- Add a migration note pointing users to DatabaseConfig
- Fix reconcile_configuration.mdx: `drop_columns` belongs to `Table`, not
  `TableRecon`

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.41%. Comparing base (7ff77c2) to head (c97beae).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2327   +/-   ##
=======================================
  Coverage   66.41%   66.41%           
=======================================
  Files          99       99           
  Lines        9094     9094           
  Branches      974      974           
=======================================
  Hits         6040     6040           
  Misses       2878     2878           
  Partials      176      176           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m-abulazm
Copy link
Contributor

thank you, I cherry picked your commit here #2329

@m-abulazm m-abulazm closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Notebook based reconciler issue

2 participants