Skip to content

Commit 47d72d0

Browse files
authored
Merge pull request #156 from oracle/dev/v1.8.2
v1.8.3
2 parents 66aebfa + 679dbda commit 47d72d0

File tree

8 files changed

+44
-10
lines changed

8 files changed

+44
-10
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Configuration variables
2-
VERSION=1.8.1
2+
VERSION=1.8.3
33
PROJ_DIR?=$(shell pwd)
44
VENV_DIR?=${PROJ_DIR}/.bldenv
55
BUILD_DIR=${PROJ_DIR}/build

dbt/adapters/oracle/__version__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2022, Oracle and/or its affiliates.
2+
Copyright (c) 2024, Oracle and/or its affiliates.
33
Copyright (c) 2020, Vitor Avancini
44
55
Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,4 +14,4 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17-
version = "1.8.1"
17+
version = "1.8.3"

dbt/adapters/oracle/relation.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2022, Oracle and/or its affiliates.
2+
Copyright (c) 2024, Oracle and/or its affiliates.
33
Copyright (c) 2020, Vitor Avancini
44
55
Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,6 +19,7 @@
1919
from dataclasses import dataclass, field
2020

2121
from dbt.adapters.base.relation import BaseRelation
22+
from dbt.adapters.contracts.relation import ComponentName
2223
from dbt.adapters.events.logging import AdapterLogger
2324
from dbt.adapters.relation_configs import (
2425
RelationConfigBase,
@@ -148,3 +149,19 @@ def materialized_view_config_changeset(
148149
return config_change_collection
149150

150151
return None
152+
153+
def _is_exactish_match(self, field: ComponentName, value: str) -> bool:
154+
"""
155+
156+
The only purpose of _is_exactish_match is to detect matches that are
157+
approximate (case-insensitive and quote-stripped) but not exact,
158+
so that dbt can raise an exception saying a too-similar relation
159+
already exists in the cache
160+
161+
"""
162+
if self.dbt_created and self.quote_policy.get_part(field) is False:
163+
return self.path.get_lowered_part(field) == value.lower()
164+
elif self.quote_policy.get_part(field) is False:
165+
return self.path.get_lowered_part(field) == value.lower()
166+
else:
167+
return self.path.get_part(field) == value

dbt/adapters/oracle/sample_profiles.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ default:
77
host: "{{ env_var('DBT_ORACLE_HOST') }}"
88
user: "{{ env_var('DBT_ORACLE_USER') }}"
99
password: "{{ env_var('DBT_ORACLE_PASSWORD') }}"
10+
database: "{{ env_var('DBT_ORACLE_DATABASE') }}"
1011
port: 1522
1112
service: "{{ env_var('DBT_ORACLE_SERVICE') }}"
1213
schema: "{{ env_var('DBT_ORACLE_SCHEMA') }}"

dbt/include/oracle/macros/relations/drop.sql

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
{#
2+
Copyright (c) 2024, Oracle and/or its affiliates.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
https://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
#}
115
{%- macro oracle__get_drop_sql(relation) -%}
216
DECLARE
317
dne_942 EXCEPTION;
@@ -10,8 +24,10 @@
1024
SAVEPOINT start_transaction;
1125
{%- if relation.is_materialized_view -%}
1226
EXECUTE IMMEDIATE '{{ oracle__drop_materialized_view(relation) }}';
27+
{%- elif relation.is_table -%}
28+
EXECUTE IMMEDIATE 'DROP table {{ relation }} cascade constraints purge';
1329
{%- else -%}
14-
EXECUTE IMMEDIATE 'DROP {{ relation.type }} {{ relation }} cascade constraint';
30+
EXECUTE IMMEDIATE 'DROP {{ relation.type }} {{ relation }} cascade constraints';
1531
{%- endif -%}
1632
COMMIT;
1733
EXCEPTION

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dbt-common>=1.1.0,<2.0
22
dbt-adapters>=1.2.1,<2.0
33
dbt-core>=1.8.1,<2.0
4-
oracledb==2.3.0
4+
oracledb==2.4.1

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = dbt-oracle
3-
version = 1.8.1
3+
version = 1.8.3
44
description = dbt (data build tool) adapter for Oracle Autonomous Database
55
long_description = file: README.md
66
long_description_content_type = text/markdown
@@ -36,7 +36,7 @@ install_requires =
3636
dbt-common>=1.1.0,<2.0
3737
dbt-adapters>=1.2.1,<2.0
3838
dbt-core~=1.8,<1.9
39-
oracledb==2.3.0
39+
oracledb==2.4.1
4040
test_suite=tests
4141
test_requires =
4242
dbt-tests-adapter~=1.8,<1.9

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"dbt-common>=1.1.0,<2.0",
4444
"dbt-adapters>=1.2.1,<2.0",
4545
"dbt-core~=1.8,<1.9",
46-
"oracledb==2.3.0"
46+
"oracledb==2.4.1"
4747
]
4848

4949
test_requirements = [
@@ -61,7 +61,7 @@
6161

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

64-
VERSION = '1.8.1'
64+
VERSION = '1.8.3'
6565
setup(
6666
author="Oracle",
6767
python_requires='>=3.8',

0 commit comments

Comments
 (0)