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 2022/11/23 20:36:56 UTC

[GitHub] [airflow] jedcunningham commented on a diff in pull request #27849: Notes stored in separate table

jedcunningham commented on code in PR #27849:
URL: https://github.com/apache/airflow/pull/27849#discussion_r1030834788


##########
airflow/models/__init__.py:
##########
@@ -69,6 +69,7 @@ def import_all_models():
     import airflow.models.dataset
     import airflow.models.serialized_dag
     import airflow.models.tasklog
+    import airflow.www.fab_security.sqla.models

Review Comment:
   (note to self: I don't think this is needed, check it)



##########
airflow/models/dagrun.py:
##########
@@ -85,6 +87,17 @@ class TISchedulingDecision(NamedTuple):
     finished_tis: list[TI]
 
 
+def _creator_note(val):
+    """Custom creator for the ``note`` association proxy."""
+    # breakpoint()

Review Comment:
   ```suggestion
   ```



##########
airflow/models/taskinstance.py:
##########
@@ -313,6 +313,17 @@ def key(self) -> TaskInstanceKey:
         return self
 
 
+def _creator_note(val):
+    """Custom creator for the ``note`` association proxy."""
+    # breakpoint()

Review Comment:
   ```suggestion
   ```



##########
airflow/www/views.py:
##########
@@ -263,19 +263,20 @@ def dag_to_grid(dag, dag_runs, session):
             TaskInstance.task_id,
             TaskInstance.run_id,
             TaskInstance.state,
-            TaskInstance.notes,
-            sqla.func.count(sqla.func.coalesce(TaskInstance.state, sqla.literal("no_status"))).label(
+            func.min(TaskInstanceNote.content).label("notes"),
+            func.count(sqla.func.coalesce(TaskInstance.state, sqla.literal("no_status"))).label(

Review Comment:
   ```suggestion
               func.count(func.coalesce(TaskInstance.state, sqla.literal("no_status"))).label(
   ```



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