Skip to content

Commit

Permalink
Removed print() statement from Python UDF
Browse files Browse the repository at this point in the history
  • Loading branch information
aosingh committed Nov 28, 2023
1 parent ea6beb7 commit a2856e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dbt/adapters/oracle/connection_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class OracleDriverType(str, enum.Enum):
description = (
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\nDefault value of ORA_PYTHON_DRIVER_TYPE is thin started with v1.7.0 "
f"\n\nStarting with dbt-oracle version 1.7, default value of ORA_PYTHON_DRIVER_TYPE is 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: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def main(action, client_identifier, clientinfo, module):
try:
setattr(connection, k, v)
except AttributeError:
print(f"Python driver does not support setting {k}")
pass # ok to be silent, ADB-S Python runtime, complains about print statements

set_connection_attributes()

Expand Down
7 changes: 7 additions & 0 deletions dbt_adbs_test_project/models/sales_py.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def model(dbt, session):
dbt.config(materialized="table")
dbt.config(async_flag=True)
dbt.config(timeout=1800)
# oml.core.DataFrame referencing a dbt-sql model
sales = session.sync(query="SELECT * FROM SH.SALES")
return sales

0 comments on commit a2856e7

Please sign in to comment.