This is an automated email from the ASF dual-hosted git repository.

eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new acd51647a4 Fix unsound type hint in ElasticsearchTaskHandler.es_read 
(#32509)
acd51647a4 is described below

commit acd51647a4f5a37c47af05d27e9783f95bcf3db3
Author: Jisuk Byun <[email protected]>
AuthorDate: Sun Jul 16 03:41:26 2023 +0900

    Fix unsound type hint in ElasticsearchTaskHandler.es_read (#32509)
    
    as ElasticsearchTaskHandler._read can invoke es_read with integer argument 
to offset parameter, type hint should be "int | str".
---
 airflow/providers/elasticsearch/log/es_task_handler.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/providers/elasticsearch/log/es_task_handler.py 
b/airflow/providers/elasticsearch/log/es_task_handler.py
index 2a780b622e..ccac90480a 100644
--- a/airflow/providers/elasticsearch/log/es_task_handler.py
+++ b/airflow/providers/elasticsearch/log/es_task_handler.py
@@ -274,7 +274,7 @@ class ElasticsearchTaskHandler(FileTaskHandler, 
ExternalLoggingMixin, LoggingMix
         # Just a safe-guard to preserve backwards-compatibility
         return log_line.message
 
-    def es_read(self, log_id: str, offset: str, metadata: dict) -> list | 
ElasticSearchResponse:
+    def es_read(self, log_id: str, offset: int | str, metadata: dict) -> list 
| ElasticSearchResponse:
         """
         Return the logs matching log_id in Elasticsearch and next offset or ''.
 

Reply via email to