utkarsharma2 commented on code in PR #38423:
URL: https://github.com/apache/airflow/pull/38423#discussion_r1609628899
##########
airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -213,6 +216,21 @@ def format_url(host: str) -> str:
return host
+ def _get_index_patterns(self, ti: TaskInstance | None) -> str:
+ """
+ Get index patterns by calling index_patterns_callable, if provided, or
the configured index_patterns.
+
+ :param ti: A TaskInstance object or None.
+ """
+ if self.index_patterns_callable:
+ self.log.debug("Using index_patterns_callable: %s",
self.index_patterns_callable)
+ module_path, index_pattern_function =
self.index_patterns_callable.rsplit(".", 1)
+ module = importlib.import_module(module_path)
+ index_pattern_callable_obj = getattr(module,
index_pattern_function)
+ return index_pattern_callable_obj(ti)
Review Comment:
We should document the signature of this function in docs.
Also, are there other variable that might be helpful in creating the index
pattern for es? or is it just TI?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]