Skip to content

Commit 84f021d

Browse files
committed
Sample test to create table not view based on git issue 178
1 parent 47d72d0 commit 84f021d

File tree

6 files changed

+88
-1
lines changed

6 files changed

+88
-1
lines changed

dbt_adbs_test_project/dbt_test.env

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export DBT_ORACLE_USER=dbt_test
2+
export DBT_ORACLE_HOST=localhost
3+
export DBT_ORACLE_PROTOCOL=tcps
4+
export DBT_ORACLE_PORT=1522
5+
export DBT_ORACLE_SERVICE=myadw_medium.adb.oraclecloud.com
6+
export DBT_ORACLE_PASSWORD=Auto_MY_DBT_1234
7+
export DBT_ORACLE_DATABASE=MYADW
8+
export DBT_ORACLE_SCHEMA=dbt_test
9+
export DBT_ORACLE_CUSTOM_SCHEMA=dbt_test
10+
export DBT_MACRO_DEBUGGING=1
11+
export WALLET_LOCATION=/scratch/tls_wallet
12+
export WALLET_PASSWORD=Auto_MY_ADB_Wallet
13+
export TNS_ADMIN=/scratch/tls_wallet
14+
export SSL_SERVER_CERT_DN="CN=3746b756d92b"
15+
export DBT_ORACLE_OML_CLOUD_SERVICE_URL=""
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{ config(materialized='table') }}
2+
3+
SELECT
4+
Cast (prop_data.property_id as int) property_id,
5+
mort_data.mortgage_id,
6+
prop_data.property_type,
7+
prop_data.living_area,
8+
--mort_data.create_date --zum zeigen von Enforce Model (contract sagt Date, aber ohne Spezification wird es Timestamp) (Null/Fehler bei Testdaten wird auch erkannt)
9+
Cast( mort_data.create_date as date) create_date
10+
FROM
11+
{{ ref('mortgage_application_seed') }} mort_data
12+
LEFT JOIN
13+
{{ ref('property_data_seed') }} prop_data
14+
ON
15+
prop_data.property_id = mort_data.mortgage_id
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: 2
2+
models:
3+
- name: property_data_product
4+
config:
5+
meta:
6+
data_contract: property-data-product
7+
owner: property_onboarding
8+
materialized: table
9+
contract:
10+
enforced: True
11+
description: This table contains all active mortgages and their financed properties.
12+
columns:
13+
- name: property_id
14+
data_tests:
15+
- dbt_expectations.expect_column_values_to_be_between:
16+
min_value: 0
17+
data_type: NUMBER
18+
description: Unique identifier for the property
19+
constraints:
20+
- type: not_null
21+
- type: unique
22+
meta:
23+
pii: false
24+
- name: mortgage_id
25+
data_tests:
26+
- dbt_expectations.expect_column_values_to_be_between:
27+
min_value: 0
28+
data_type: NUMBER
29+
description: Unique identifier for the mortgage agreement
30+
constraints:
31+
- type: not_null
32+
meta:
33+
pii: false
34+
- name: property_type
35+
data_type: STRING
36+
description: Type of the property like single-family home.
37+
meta:
38+
pii: false
39+
- name: living_area
40+
data_type: FLOAT
41+
description: Living area of the property
42+
meta:
43+
pii: false
44+
- name: create_date
45+
data_type: DATE
46+
description: Creation date of the mortgage agreement
47+
meta:
48+
pii: false
49+

dbt_adbs_test_project/profiles.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ dbt_test:
1111
service: "{{ env_var('DBT_ORACLE_SERVICE') }}"
1212
database: "{{ env_var('DBT_ORACLE_DATABASE') }}"
1313
schema: "{{ env_var('DBT_ORACLE_SCHEMA') }}"
14-
oml_cloud_service_url: "{{ env_var('DBT_ORACLE_OML_CLOUD_SERVICE_URL')}}"
1514
session_info:
1615
action: "dbt run"
1716
client_identifier: "dbt-mac-abhisoms"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mortgage_id,create_date
2+
1,2025-06-03
3+
2,2025-01-20
4+
3,2024-02-03
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
property_id,property_type,living_area
2+
1,commercial,200.34
3+
2,office,3000.0
4+
3,retail,2020.0
5+
4,apartment,690.4

0 commit comments

Comments
 (0)