You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/08 05:54:46 UTC

[GitHub] [airflow] dungdm93 commented on a diff in pull request #24311: Update Oracle library to latest version

dungdm93 commented on code in PR #24311:
URL: https://github.com/apache/airflow/pull/24311#discussion_r891946313


##########
airflow/providers/oracle/hooks/oracle.py:
##########
@@ -135,35 +135,35 @@ def get_conn(self) -> 'OracleHook':
 
         mode = conn.extra_dejson.get('mode', '').lower()
         if mode == 'sysdba':
-            conn_config['mode'] = cx_Oracle.SYSDBA
+            conn_config['mode'] = oracledb.SYSDBA
         elif mode == 'sysasm':
-            conn_config['mode'] = cx_Oracle.SYSASM
+            conn_config['mode'] = oracledb.SYSASM
         elif mode == 'sysoper':
-            conn_config['mode'] = cx_Oracle.SYSOPER
+            conn_config['mode'] = oracledb.SYSOPER
         elif mode == 'sysbkp':
-            conn_config['mode'] = cx_Oracle.SYSBKP
+            conn_config['mode'] = oracledb.SYSBKP
         elif mode == 'sysdgd':
-            conn_config['mode'] = cx_Oracle.SYSDGD
+            conn_config['mode'] = oracledb.SYSDGD
         elif mode == 'syskmt':
-            conn_config['mode'] = cx_Oracle.SYSKMT
+            conn_config['mode'] = oracledb.SYSKMT
         elif mode == 'sysrac':
-            conn_config['mode'] = cx_Oracle.SYSRAC
+            conn_config['mode'] = oracledb.SYSRAC
 
         purity = conn.extra_dejson.get('purity', '').lower()
         if purity == 'new':
-            conn_config['purity'] = cx_Oracle.ATTR_PURITY_NEW
+            conn_config['purity'] = oracledb.ATTR_PURITY_NEW
         elif purity == 'self':
-            conn_config['purity'] = cx_Oracle.ATTR_PURITY_SELF
+            conn_config['purity'] = oracledb.ATTR_PURITY_SELF
         elif purity == 'default':
-            conn_config['purity'] = cx_Oracle.ATTR_PURITY_DEFAULT
+            conn_config['purity'] = oracledb.ATTR_PURITY_DEFAULT

Review Comment:
   `ATTR_PURITY_*` are aliases for backwards compatibility.
   I think it's better to use those new props:
   ```python
   oracledb.PURITY_DEFAULT
   oracledb.PURITY_NEW
   oracledb.PURITY_SELF
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org