Skip to content

Commit 17c129b

Browse files
fix changelog (#900)
Co-authored-by: jochenchrist <[email protected]>
1 parent eb890f7 commit 17c129b

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121

2222
- Export to DQX: Correct DQX format for global-level quality check of data contract export. (#877)
2323
- Import the table tags from a open data contract spec v3 (#895)
24+
- dbt export: Enhanced model-level primaryKey support with automatic test generation for single and multiple column primary keys (#898)
2425

2526
## [0.10.35] - 2025-08-25
2627

tests/test_export_dbt_models.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,13 @@ def test_to_dbt_models_with_model_level_composite_primary_key():
206206
id="my-data-contract-id",
207207
info=Info(title="My Data Contract", version="0.0.1"),
208208
models={
209-
"sfdc_loc_tenants_test": Model(
209+
"test_table": Model(
210210
type="table",
211-
primaryKey=["tenant_id", "account_id"], # Model-level composite primary key
211+
primaryKey=["order_id", "user_id"], # Model-level composite primary key
212212
fields={
213-
"tenant_id": Field(type="string", required=True),
214-
"account_id": Field(type="string", required=True),
215-
"name": Field(type="string", required=True),
213+
"order_id": Field(type="string", required=True),
214+
"user_id": Field(type="string", required=True),
215+
"product_id": Field(type="string", required=True)
216216
},
217217
)
218218
},
@@ -221,7 +221,7 @@ def test_to_dbt_models_with_model_level_composite_primary_key():
221221
expected_dbt_model = """
222222
version: 2
223223
models:
224-
- name: sfdc_loc_tenants_test
224+
- name: test_table
225225
config:
226226
meta:
227227
data_contract: my-data-contract-id
@@ -231,18 +231,18 @@ def test_to_dbt_models_with_model_level_composite_primary_key():
231231
data_tests:
232232
- dbt_utils.unique_combination_of_columns:
233233
combination_of_columns:
234-
- tenant_id
235-
- account_id
234+
- order_id
235+
- user_id
236236
columns:
237-
- name: tenant_id
237+
- name: order_id
238238
data_type: STRING
239239
constraints:
240240
- type: not_null
241-
- name: account_id
241+
- name: user_id
242242
data_type: STRING
243243
constraints:
244244
- type: not_null
245-
- name: name
245+
- name: product_id
246246
data_type: STRING
247247
constraints:
248248
- type: not_null
@@ -263,13 +263,13 @@ def test_to_dbt_models_with_single_column_primary_key():
263263
id="my-data-contract-id",
264264
info=Info(title="My Data Contract", version="0.0.1"),
265265
models={
266-
"sfdc_loc_tenants_test": Model(
266+
"test_table": Model(
267267
type="table",
268-
primaryKey=["tenant_id"], # Model-level single primary key
268+
primaryKey=["order_id"], # Model-level single primary key
269269
fields={
270-
"tenant_id": Field(type="string", required=True),
271-
"account_id": Field(type="string", required=True),
272-
"name": Field(type="string", required=True),
270+
"order_id": Field(type="string", required=True),
271+
"user_id": Field(type="string", required=True),
272+
"product_id": Field(type="string", required=True)
273273
},
274274
)
275275
},
@@ -278,24 +278,24 @@ def test_to_dbt_models_with_single_column_primary_key():
278278
expected_dbt_model = """
279279
version: 2
280280
models:
281-
- name: sfdc_loc_tenants_test
281+
- name: test_table
282282
config:
283283
meta:
284284
data_contract: my-data-contract-id
285285
materialized: table
286286
contract:
287287
enforced: true
288288
columns:
289-
- name: tenant_id
289+
- name: order_id
290290
data_type: STRING
291291
constraints:
292292
- type: not_null
293293
- type: unique
294-
- name: account_id
294+
- name: user_id
295295
data_type: STRING
296296
constraints:
297297
- type: not_null
298-
- name: name
298+
- name: product_id
299299
data_type: STRING
300300
constraints:
301301
- type: not_null

0 commit comments

Comments
 (0)