Skip to content

Commit

Permalink
Resolve deprecations in OracleHook (#40199)
Browse files Browse the repository at this point in the history
  • Loading branch information
boraberke authored Jun 12, 2024
1 parent f0b51cd commit c1ffe45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
14 changes: 0 additions & 14 deletions tests/deprecations_ignore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,20 +341,6 @@
- tests/providers/mysql/operators/test_mysql.py::TestMySql::test_mysql_operator_test_multi
- tests/providers/mysql/operators/test_mysql.py::TestMySql::test_overwrite_schema
- tests/providers/mysql/operators/test_mysql.py::test_execute_openlineage_events
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_get_conn_events
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_get_conn_host
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_get_conn_host_alternative_port
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_get_conn_mode
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_get_conn_purity
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_oracledb_defaults_attributes_default_values
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_set_oracledb_defaults_attributes_extra
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_set_oracledb_defaults_attributes_extra_str
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_set_oracledb_defaults_attributes_params
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_set_thick_mode_extra
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_set_thick_mode_extra_str
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_set_thick_mode_params
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_thick_mode_defaults_to_false
- tests/providers/oracle/hooks/test_oracle.py::TestOracleHookConn::test_thick_mode_dirs_defaults
- tests/providers/postgres/hooks/test_postgres.py::TestPostgresHookConn::test_schema_kwarg_database_kwarg_compatibility
- tests/providers/postgres/operators/test_postgres.py::test_parameters_are_templatized
- tests/providers/postgres/operators/test_postgres.py::TestPostgres::test_overwrite_database
Expand Down
6 changes: 3 additions & 3 deletions tests/providers/oracle/hooks/test_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class TestOracleHookConn:
def setup_method(self):
self.connection = Connection(
login="login", password="password", host="host", schema="schema", port=1521
login="login", password="password", host="host", port=1521, extra='{"service_name": "schema"}'
)

self.db_hook = OracleHook()
Expand All @@ -47,7 +47,7 @@ def test_get_conn_host(self, mock_connect):
assert args == ()
assert kwargs["user"] == "login"
assert kwargs["password"] == "password"
assert kwargs["dsn"] == "host:1521/schema"
assert kwargs["dsn"] == oracledb.makedsn("host", 1521, service_name="schema")

@mock.patch("airflow.providers.oracle.hooks.oracle.oracledb.connect")
def test_get_conn_host_alternative_port(self, mock_connect):
Expand All @@ -58,7 +58,7 @@ def test_get_conn_host_alternative_port(self, mock_connect):
assert args == ()
assert kwargs["user"] == "login"
assert kwargs["password"] == "password"
assert kwargs["dsn"] == "host:1522/schema"
assert kwargs["dsn"] == oracledb.makedsn("host", self.connection.port, service_name="schema")

@mock.patch("airflow.providers.oracle.hooks.oracle.oracledb.connect")
def test_get_conn_sid(self, mock_connect):
Expand Down

0 comments on commit c1ffe45

Please sign in to comment.