Skip to content

Commit 3cd1b52

Browse files
authored
Merge pull request #105 from oracle/1.5-backports
dbt-oracle 1.5 bugfixes backports
2 parents 73789d5 + 48068d8 commit 3cd1b52

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Configuration variables
2-
VERSION=1.5.2
2+
VERSION=1.5.3
33
PROJ_DIR?=$(shell pwd)
44
VENV_DIR?=${PROJ_DIR}/.bldenv
55
BUILD_DIR=${PROJ_DIR}/build

dbt/adapters/oracle/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17-
version = "1.5.3"
17+
version = "1.5.6"

dbt/adapters/oracle/connection_helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import dbt.exceptions
2121
from dbt.events import AdapterLogger
2222

23-
from dbt.ui import warning_tag, yellow
23+
from dbt.ui import warning_tag, red
2424

2525
logger = AdapterLogger("oracle")
2626

@@ -104,14 +104,14 @@ class OracleDriverType(str, enum.Enum):
104104
if ORA_PYTHON_DRIVER_TYPE == OracleDriverType.CX_ORACLE:
105105
logger.info("Running in cx mode")
106106
description = (
107-
f"cx_oracle will soon be deprecated, use python-oracledb"
107+
f"cx_oracle is no longer maintained, use python-oracledb"
108108
f"\n\nTo switch to python-oracledb set the environment variable ORA_PYTHON_DRIVER_TYPE=thin "
109109
f"\n\nRead the guideline here: "
110110
f"https://docs.getdbt.com/reference/warehouse-setups/oracle-setup#configure-the-python-driver-mode"
111111
f"\n\nDocumentation for python-oracledb can be found here: "
112112
f"https://oracle.github.io/python-oracledb/"
113113
)
114-
logger.warning(warning_tag(yellow(description)))
114+
logger.warning(warning_tag(red(description)))
115115
import cx_Oracle as oracledb
116116
elif ORA_PYTHON_DRIVER_TYPE == OracleDriverType.THICK:
117117
import oracledb

dbt/adapters/oracle/connections.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ def open(cls, connection):
192192
'dsn': dsn
193193
}
194194

195+
if oracledb.__name__ == "oracledb":
196+
conn_config['connection_id_prefix'] = 'dbt-oracle-'
197+
195198
if credentials.shardingkey:
196199
conn_config['shardingkey'] = credentials.shardingkey
197200

dbt/adapters/oracle/impl.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,8 @@ def date_function(cls):
104104

105105
@classmethod
106106
def convert_text_type(cls, agate_table, col_idx):
107-
column = agate_table.columns[col_idx]
108-
lens = (len(d.encode("utf-8")) for d in column.values_without_nulls())
109-
max_len = max(lens) if lens else 64
110-
length = max_len if max_len > 16 else 16
111-
return "varchar2({})".format(length)
107+
# Keep this consistent with STRING/TEXT datatypes mapped to "VARCHAR2(4000)"
108+
return "varchar2(4000)"
112109

113110
@classmethod
114111
def convert_date_type(cls, agate_table, col_idx):

dbt/include/oracle/macros/catalog.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
data_precision numeric_precision,
4444
data_scale numeric_scale,
4545
nullable is_nullable,
46-
column_id ordinal_position,
46+
coalesce(column_id, 0) ordinal_position,
4747
default_length,
4848
data_default column_default,
4949
num_distinct,

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = dbt-oracle
3-
version = 1.5.2
3+
version = 1.5.3
44
description = dbt (data build tool) adapter for the Oracle database
55
long_description = file: README.md
66
long_description_content_type = text/markdown

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

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

55-
VERSION = '1.5.2'
55+
VERSION = '1.5.3'
5656
setup(
5757
author="Oracle",
5858
python_requires='>=3.7.2',

0 commit comments

Comments
 (0)