Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

OsLogMsgType = list[StructuredLogMessage] | str
else:
OsLogMsgType = list[tuple[str, str]] # type: ignore[assignment,no-redef,misc]
OsLogMsgType = list[tuple[str, str]] # type: ignore[assignment,misc]


USE_PER_RUN_LOG_ID = hasattr(DagRun, "get_log_template")
Expand Down Expand Up @@ -186,7 +186,7 @@ def __init__(
)
# client = OpenSearch(hosts=[{"host": host, "port": port}], http_auth=(username, password), use_ssl=True, verify_certs=True, ca_cert="/opt/airflow/root-ca.pem", ssl_assert_hostname = False, ssl_show_warn = False)
self.formatter: logging.Formatter
self.handler: logging.FileHandler | logging.StreamHandler # type: ignore[assignment]
self.handler: logging.FileHandler | logging.StreamHandler
self._doc_type_map: dict[Any, Any] = {}
self._doc_type: list[Any] = []

Expand Down Expand Up @@ -255,7 +255,7 @@ def close(self) -> None:

# Reopen the file stream, because FileHandler.close() would be called
# first in logging.shutdown() and the stream in it would be set to None.
if self.handler.stream is None or self.handler.stream.closed: # type: ignore[attr-defined]
if self.handler.stream is None or self.handler.stream.closed:
self.handler.stream = self.handler._open() # type: ignore[union-attr]

# Mark the end of file using end of log mark,
Expand Down Expand Up @@ -304,7 +304,7 @@ def _render_log_id(self, ti: TaskInstance | TaskInstanceKey, try_number: int) ->
if TYPE_CHECKING:
assert dag is not None
# TODO: Task-SDK: Where should this function be?
data_interval = dag.get_run_data_interval(dag_run) # type: ignore[attr-defined,union-attr]
data_interval = dag.get_run_data_interval(dag_run) # type: ignore[attr-defined]

if self.json_format:
data_interval_start = self._clean_date(data_interval[0])
Expand Down Expand Up @@ -452,7 +452,7 @@ def _os_read(self, log_id: str, offset: int | str, ti: TaskInstance) -> Opensear
}
index_patterns = self._get_index_patterns(ti)
try:
max_log_line = self.client.count(index=index_patterns, body=query)["count"] # type: ignore
max_log_line = self.client.count(index=index_patterns, body=query)["count"]
except NotFoundError as e:
self.log.exception("The target index pattern %s does not exist", index_patterns)
raise e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

class FakeDocument(Document):
# TODO: FIXME - this Fake document has something tricky about typing
title = Text(fields={"raw": Keyword()}) # type: ignore[call-arg]
title = Text(fields={"raw": Keyword()})
author = Text()
published = Text()

Expand Down