dstandish commented on code in PR #40468:
URL: https://github.com/apache/airflow/pull/40468#discussion_r1664376050
##########
airflow/utils/log/task_context_logger.py:
##########
@@ -24,14 +24,44 @@
from typing import TYPE_CHECKING
from airflow.configuration import conf
+from airflow.exceptions import AirflowException
+from airflow.models.taskinstancekey import TaskInstanceKey
+from airflow.utils.session import create_session
if TYPE_CHECKING:
from airflow.models.taskinstance import TaskInstance
+ from airflow.serialization.pydantic.taskinstance import
TaskInstancePydantic
from airflow.utils.log.file_task_handler import FileTaskHandler
logger = logging.getLogger(__name__)
+def ensure_ti(ti: TaskInstanceKey | TaskInstance | TaskInstancePydantic,
session) -> TaskInstance:
Review Comment:
> The reason why I put it in public is we use it in a different file, thus
keeping it "private" would not make sense
see here: https://github.com/apache/airflow/pull/40468#discussion_r1664372781
> (me, quoted from there) i would personally rather have duplication, or
"internal" importing of single underscore methods, than unnecessarily expanding
public interface. it's a real pain when we have to worry about making updates
to things that no user should be using.
we don't really have sufficient expressive power to say "internal public and
externally private" except with like, the sphinx directive which is not ideal
since it's hard to notice.
--
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]