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 2021/08/24 05:30:00 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #17777: get_pandas_df() fails when it tries to read an empty table

uranusjr commented on a change in pull request #17777:
URL: https://github.com/apache/airflow/pull/17777#discussion_r694503504



##########
File path: tests/providers/apache/hive/hooks/test_hive.py
##########
@@ -687,6 +687,13 @@ def test_get_pandas_df(self):
         hook.mock_cursor.execute.assert_any_call('set airflow.ctx.dag_owner=airflow')
         hook.mock_cursor.execute.assert_any_call('set airflow.ctx.dag_email=test@airflow.com')
 
+        hook = MockHiveServer2Hook(empty_table_flag = True)

Review comment:
       I’d probably do something like `MockHiveServer2Hook(connection_cursor=EmptyMockTableCursor())` instead. `EmptyMockTableCursor` would inherit from a new `BaseMockHiveServer2Hook` class that contains common logic refactored out of `MockHiveServer2Hook` (which would then also inherit from `BaseMockHiveServer2Hook`).




-- 
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