Skip to content

Commit

Permalink
Fix provider.yaml and test
Browse files Browse the repository at this point in the history
  • Loading branch information
jason810496 committed Dec 4, 2024
1 parent 4b965ce commit ee43b81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ hooks:
- airflow.providers.elasticsearch.hooks.elasticsearch

connection-types:
- hook-class-name: airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchHook
- hook-class-name: airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchSQLHook
connection-type: elasticsearch

logging:
Expand Down
8 changes: 4 additions & 4 deletions providers/tests/elasticsearch/hooks/test_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class TestElasticsearchSQLHookConn:
def setup_method(self):
self.connection = Connection(host="localhost", port=9200, schema="http")

class UnitTestElasticsearchHook(ElasticsearchSQLHook):
class UnitTestElasticsearchSQLHook(ElasticsearchSQLHook):
conn_name_attr = "elasticsearch_conn_id"

self.db_hook = UnitTestElasticsearchHook()
self.db_hook = UnitTestElasticsearchSQLHook()
self.db_hook.get_connection = mock.Mock()
self.db_hook.get_connection.return_value = self.connection

Expand All @@ -55,13 +55,13 @@ def setup_method(self):
self.conn.cursor.return_value = self.cur
conn = self.conn

class UnitTestElasticsearchHook(ElasticsearchSQLHook):
class UnitTestElasticsearchSQLHook(ElasticsearchSQLHook):
conn_name_attr = "test_conn_id"

def get_conn(self):
return conn

self.db_hook = UnitTestElasticsearchHook()
self.db_hook = UnitTestElasticsearchSQLHook()

def test_get_first_record(self):
statement = "SQL"
Expand Down
3 changes: 0 additions & 3 deletions tests/always/test_project_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,6 @@ class TestElasticsearchProviderProjectStructure(ExampleCoverageTest):
PROVIDER = "elasticsearch"
CLASS_DIRS = {"hooks"}
CLASS_SUFFIXES = ["Hook"]
DEPRECATED_CLASSES = {
"airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchHook",
}


class TestCncfProviderProjectStructure(ExampleCoverageTest):
Expand Down

0 comments on commit ee43b81

Please sign in to comment.