Skip to content

Fix missing _dlt_loads creation in class-based destination#14

Merged
nicosuave merged 3 commits intomainfrom
fix-dlt-loads-table
Feb 11, 2026
Merged

Fix missing _dlt_loads creation in class-based destination#14
nicosuave merged 3 commits intomainfrom
fix-dlt-loads-table

Conversation

@nicosuave
Copy link
Copy Markdown
Member

Summary

  • persist load completion metadata in complete_load() by writing a row to _dlt_loads
  • create namespace._dlt_loads on first use if missing
  • add regression test to verify _dlt_loads exists and stores expected load ids across runs

Context

_dlt_loads was not being materialized for this destination, which breaks dlt internal load tracking.

Fixes #13

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 240637eff5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +597 to +599
expected_schema = schema_to_pyarrow(loads_table.schema())
casted_row = cast_table_safe(load_row, expected_schema, strict=False)
loads_table.append(casted_row)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retry and harden _dlt_loads append after data commit

complete_load clears pending files and commits user tables before this append, but _store_completed_load performs a single non-retried metadata write; if a transient catalog/network error happens here, the load is reported as failed even though data is already committed, which can leave recovery in an inconsistent state and may trigger replay behavior on retry. This path should use the same retry/idempotency guarantees as table commits.

Useful? React with 👍 / 👎.

Comment on lines +590 to +594
catalog.create_table(
identifier=identifier,
schema=loads_schema,
partition_spec=PartitionSpec(),
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor custom table location when creating _dlt_loads

When _dlt_loads is created on first use, the code bypasses _get_table_location and always relies on catalog defaults, unlike normal table creation; with table_location_layout configured, this creates internal metadata in a different path (and can fail in environments where only the configured layout path is writable). The same location-resolution logic used for data tables should be applied here.

Useful? React with 👍 / 👎.

@nicosuave nicosuave merged commit ca663aa into main Feb 11, 2026
1 check passed
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.

_dlt_loads was not created

1 participant