Skip to content

Commit

Permalink
Merge pull request #152 from oracle/dev/1.8.1
Browse files Browse the repository at this point in the history
v1.8.1
  • Loading branch information
aosingh authored Aug 21, 2024
2 parents 9ca25a4 + ff93789 commit 66aebfa
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Configuration variables
VERSION=1.8.0
VERSION=1.8.1
PROJ_DIR?=$(shell pwd)
VENV_DIR?=${PROJ_DIR}/.bldenv
BUILD_DIR=${PROJ_DIR}/build
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/oracle/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
version = "1.8.0"
version = "1.8.1"
4 changes: 3 additions & 1 deletion dbt/include/oracle/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
{%- endif -%}
{%- if col['data_type'] | lower == 'clob' -%}
empty_clob() as {{ col['name'] }}{{ ", " if not loop.last }}
{%- elif col['data_type'] | lower == 'blob' -%}
empty_blob() as {{ col['name'] }}{{ ", " if not loop.last }}
{%- else -%}
cast(null as {{ col['data_type'] }}) as {{ col['name'] }}{{ ", " if not loop.last }}
{%- endif -%}
Expand All @@ -63,7 +65,7 @@
) model_subq
{%- endmacro %}

{% macro oracle__create_schema(relation, schema_name) -%}
{% macro oracle__create_schema(relation) -%}
{% if relation.database -%}
{{ adapter.verify_database(relation.database) }}
{%- endif -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
{% endif %}

{% if not adapter.check_schema_exists(model_database, model.schema) %}
{% do create_schema(model_database, model.schema) %}
{% do create_schema(model.schema) %}
{% endif %}

{% set target_relation_exists, target_relation = get_or_create_relation(
Expand Down
10 changes: 9 additions & 1 deletion dbt/include/oracle/macros/show.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{#
Copyright (c) 2023, Oracle and/or its affiliates.
Copyright (c) 2024, Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -21,3 +21,11 @@
)
fetch first {{ limit }} rows only
{% endmacro %}


{% macro oracle__get_limit_sql(sql, limit) %}
{{ compiled_code }}
{% if limit is not none %}
fetch first {{ limit }} rows only
{%- endif -%}
{% endmacro %}
1 change: 1 addition & 0 deletions dbt_adbs_test_project/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ seeds:
kafka_message:
+column_types:
message: CLOB
blob_message: BLOB
seed_with_empty_col:
+column_types:
id: number
Expand Down
2 changes: 1 addition & 1 deletion dbt_adbs_test_project/models/kafka.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
select * from {{ ref('kafka_message') }}
select * from {{ ref('kafka_message') }}
2 changes: 1 addition & 1 deletion dbt_adbs_test_project/models/promotion_costs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
#}
{{ config(materialized='table')}}
{{ config(materialized='table', grants = {'select': ['dbt_test_1']})}}
with all_promo_costs as(
select * from {{ source('sh_database', 'promotions') }}
)
Expand Down
5 changes: 5 additions & 0 deletions dbt_adbs_test_project/models/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ models:
data_type: CLOB
constraints:
- type: not_null
- name: blob_message
description: Kafka message
data_type: BLOB
constraints:
- type: not_null


- name: people
Expand Down
2 changes: 1 addition & 1 deletion dbt_adbs_test_project/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dbt_test:
host: "{{ env_var('DBT_ORACLE_HOST') }}"
port: 1522
service: "{{ env_var('DBT_ORACLE_SERVICE') }}"
# database: "{{ env_var('DBT_ORACLE_DATABASE') }}"
database: "{{ env_var('DBT_ORACLE_DATABASE') }}"
schema: "{{ env_var('DBT_ORACLE_SCHEMA') }}"
oml_cloud_service_url: "{{ env_var('DBT_ORACLE_OML_CLOUD_SERVICE_URL')}}"
session_info:
Expand Down
10 changes: 5 additions & 5 deletions dbt_adbs_test_project/seeds/kafka_message.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
message
Jack-Hunter
Jack-Hunter
Jack-HunterJackHunter
Jack-Hunter
message,blob_message
Jack-Hunter,1234
Jack-Hunter,123124
Jack-HunterJackHunter,123123
Jack-Hunter,123143
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dbt-common>=1.1.0,<2.0
dbt-adapters>=1.2.1,<2.0
dbt-core>=1.8.1,<2.0
oracledb==2.2.1
oracledb==2.3.0
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dbt-oracle
version = 1.8.0
version = 1.8.1
description = dbt (data build tool) adapter for Oracle Autonomous Database
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down Expand Up @@ -36,7 +36,7 @@ install_requires =
dbt-common>=1.1.0,<2.0
dbt-adapters>=1.2.1,<2.0
dbt-core~=1.8,<1.9
oracledb==2.2.1
oracledb==2.3.0
test_suite=tests
test_requires =
dbt-tests-adapter~=1.8,<1.9
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"dbt-common>=1.1.0,<2.0",
"dbt-adapters>=1.2.1,<2.0",
"dbt-core~=1.8,<1.9",
"oracledb==2.2.1"
"oracledb==2.3.0"
]

test_requirements = [
Expand All @@ -61,7 +61,7 @@

url = 'https://github.com/oracle/dbt-oracle'

VERSION = '1.8.0'
VERSION = '1.8.1'
setup(
author="Oracle",
python_requires='>=3.8',
Expand Down

0 comments on commit 66aebfa

Please sign in to comment.