Skip to content

Commit

Permalink
Merge pull request #107 from oracle/rkope-1.4-backports
Browse files Browse the repository at this point in the history
1.4 Backports for bug fixes (same as 1.5 backports)
  • Loading branch information
rkope99 authored Oct 11, 2023
2 parents f5b1ec5 + aaa4890 commit 8d06d6f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 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.4.2
VERSION=1.4.3
PROJ_DIR?=$(shell pwd)
VENV_DIR?=${PROJ_DIR}/.bldenv
BUILD_DIR=${PROJ_DIR}/build
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ security features are welcome on GitHub Issues.

Security updates will be released on a regular cadence. Many of our projects
will typically release security fixes in conjunction with the
[Oracle Critical Patch Update][3] program. Additional
Oracle Critical Patch Update program. Additional
information, including past advisories, is available on our [security alerts][4]
page.

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.4.5"
version = "1.4.8"
6 changes: 3 additions & 3 deletions dbt/adapters/oracle/connection_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import dbt.exceptions
from dbt.events import AdapterLogger

from dbt.ui import warning_tag, yellow
from dbt.ui import warning_tag, red

logger = AdapterLogger("oracle")

Expand Down Expand Up @@ -104,14 +104,14 @@ class OracleDriverType(str, enum.Enum):
if ORA_PYTHON_DRIVER_TYPE == OracleDriverType.CX_ORACLE:
logger.info("Running in cx mode")
description = (
f"cx_oracle will soon be deprecated, use python-oracledb"
f"cx_oracle is no longer maintained, use python-oracledb"
f"\n\nTo switch to python-oracledb set the environment variable ORA_PYTHON_DRIVER_TYPE=thin "
f"\n\nRead the guideline here: "
f"https://docs.getdbt.com/reference/warehouse-setups/oracle-setup#configure-the-python-driver-mode"
f"\n\nDocumentation for python-oracledb can be found here: "
f"https://oracle.github.io/python-oracledb/"
)
logger.warning(warning_tag(yellow(description)))
logger.warning(warning_tag(red(description)))
import cx_Oracle as oracledb
elif ORA_PYTHON_DRIVER_TYPE == OracleDriverType.THICK:
import oracledb
Expand Down
3 changes: 3 additions & 0 deletions dbt/adapters/oracle/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ def open(cls, connection):
'dsn': dsn
}

if oracledb.__name__ == "oracledb":
conn_config['connection_id_prefix'] = 'dbt-oracle-'

if credentials.shardingkey:
conn_config['shardingkey'] = credentials.shardingkey

Expand Down
7 changes: 2 additions & 5 deletions dbt/adapters/oracle/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,8 @@ def date_function(cls):

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

@classmethod
def convert_date_type(cls, agate_table, col_idx):
Expand Down
2 changes: 1 addition & 1 deletion dbt/include/oracle/macros/catalog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
data_precision numeric_precision,
data_scale numeric_scale,
nullable is_nullable,
column_id ordinal_position,
coalesce(column_id, 0) ordinal_position,
default_length,
data_default column_default,
num_distinct,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dbt-oracle
version = 1.4.2
version = 1.4.3
description = dbt (data build tool) adapter for the Oracle database
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

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

VERSION = '1.4.2'
VERSION = '1.4.3'
setup(
author="Oracle",
python_requires='>=3.7.2',
Expand Down

0 comments on commit 8d06d6f

Please sign in to comment.