Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Oct 18, 2023
1 parent 903f000 commit 912dd8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/website/docs/general-usage/data-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def items():
This resource will allow new subtables to be created, but will throw an exception if data is extracted for an existing table which
contains a new column.

### Possible settings

The `schema_contract` exists on the `source` decorator as a directive for all resources of that source and on the
`resource` decorator as a directive for the individual resource. Additionally it exists on the `pipeline.run()` method, which will override all existing settings.
The `schema_contract` is a dictionary with keys that control the following:
Expand All @@ -34,6 +36,8 @@ Each property can be set to one of three values:
* `discard_row`: This will discard any extracted row if it does not adhere to the existing schema, and this row will not be loaded to the destination. All other rows will be.
* `discard_value`: This will discard data in an extracted row that does not adhere to the existing schema and the row will be loaded without this data.

If a table is a new table that has not been created on the destination yet, dlt will allow the creation of all columns and variants on the first run

### Code Examples

The below code will silently ignore new subtables, allow new columns to be added to existing tables and raise an error if a variant of a column is discovered.
Expand Down
2 changes: 1 addition & 1 deletion docs/website/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ Each event type is sent to a different table in `duckdb`.
import dlt
from dlt.sources.helpers import requests

@dlt.resource(primary_key="id", table_name=lambda i: i["type"], write_disposition="append") # type: ignore
@dlt.resource(primary_key="id", table_name=lambda i: i["type"], write_disposition="append")
def repo_events(
last_created_at = dlt.sources.incremental("created_at")
):
Expand Down
1 change: 1 addition & 0 deletions docs/website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const sidebars = {
'general-usage/full-loading',
'general-usage/credentials',
'general-usage/schema',
'general-usage/data-contracts',
'general-usage/configuration',
'reference/performance',
{
Expand Down

0 comments on commit 912dd8b

Please sign in to comment.