From 65c434017f8ef54eff140500cb7622a95cefe761 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Thu, 2 Nov 2023 10:02:14 -0700 Subject: [PATCH] bugfix for https://github.com/oracle/dbt-oracle/issues/110 --- Makefile | 2 +- dbt/adapters/oracle/__version__.py | 2 +- dbt/adapters/oracle/connections.py | 11 +++++++++-- requirements.txt | 2 +- setup.cfg | 4 ++-- setup.py | 4 ++-- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index abbd372..fd36472 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Configuration variables -VERSION=1.5.3 +VERSION=1.5.4 PROJ_DIR?=$(shell pwd) VENV_DIR?=${PROJ_DIR}/.bldenv BUILD_DIR=${PROJ_DIR}/build diff --git a/dbt/adapters/oracle/__version__.py b/dbt/adapters/oracle/__version__.py index 3a5adc5..76a5f86 100644 --- a/dbt/adapters/oracle/__version__.py +++ b/dbt/adapters/oracle/__version__.py @@ -14,4 +14,4 @@ See the License for the specific language governing permissions and limitations under the License. """ -version = "1.5.6" +version = "1.5.9" diff --git a/dbt/adapters/oracle/connections.py b/dbt/adapters/oracle/connections.py index 194bf8a..327f77b 100644 --- a/dbt/adapters/oracle/connections.py +++ b/dbt/adapters/oracle/connections.py @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ +import json from typing import List, Optional, Tuple, Any, Dict, Union from contextlib import contextmanager from dataclasses import dataclass, field @@ -219,8 +220,14 @@ def open(cls, connection): try: handle = oracledb.connect(**conn_config) # client_identifier and module are saved in corresponding columns in v$session - handle.module = f'dbt-{dbt_version}' - handle.client_identifier = f'dbt-oracle-client-{uuid.uuid4()}' + action = "dbt run" + client_identifier = f'dbt-oracle-client-{uuid.uuid4()}' + module = f'dbt-{dbt_version}' + client_info = {"action": action, "client_identifier": client_identifier, "module": module} + logger.info(f"Session info :{json.dumps(client_info)}") + handle.module = module + handle.client_identifier = client_identifier + handle.action = action connection.handle = handle connection.state = 'open' except oracledb.DatabaseError as e: diff --git a/requirements.txt b/requirements.txt index f0f4c21..b0ebdea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ dbt-core~=1.5,<1.6 cx_Oracle==8.3.0 -oracledb==1.4.1 +oracledb==1.4.2 diff --git a/setup.cfg b/setup.cfg index a3c6d72..a27224c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dbt-oracle -version = 1.5.3 +version = 1.5.4 description = dbt (data build tool) adapter for the Oracle database long_description = file: README.md long_description_content_type = text/markdown @@ -35,7 +35,7 @@ include_package_data = True install_requires = dbt-core~=1.5,<1.6 cx_Oracle==8.3.0 - oracledb==1.4.1 + oracledb==1.4.2 test_suite=tests test_requires = dbt-tests-adapter~=1.5,<1.6 diff --git a/setup.py b/setup.py index 44c8bbb..993c1f3 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ requirements = [ "dbt-core~=1.5,<1.6", "cx_Oracle==8.3.0", - "oracledb==1.4.1" + "oracledb==1.4.2" ] test_requirements = [ @@ -52,7 +52,7 @@ url = 'https://github.com/oracle/dbt-oracle' -VERSION = '1.5.3' +VERSION = '1.5.4' setup( author="Oracle", python_requires='>=3.7.2',