ashb commented on a change in pull request #7633: [AIRFLOW-6989] Store
UnRenderedTemplateFields in SerializedDag table
URL: https://github.com/apache/airflow/pull/7633#discussion_r389594566
##########
File path: tests/www/test_views.py
##########
@@ -1922,6 +1922,24 @@ def test_rendered_view(self, get_dag_function):
resp = self.client.get(url, follow_redirects=True)
self.check_content_in_response("testdag__testtask__20200301", resp)
+ @mock.patch('airflow.www.views.STORE_SERIALIZED_DAGS', True)
+ @mock.patch('airflow.models.taskinstance.STORE_SERIALIZED_DAGS', True)
+ @mock.patch('airflow.www.views.dagbag.get_dag')
+ def test_rendered_view_for_unexecuted_tis(self, get_dag_function):
+ """
+ Test that the Rendered View is able to show rendered values
+ even for TIs that have not yet executed
+ """
+ get_dag_function.return_value =
SerializedDagModel.get(self.dag.dag_id).dag
+
+ self.assertEqual(self.task.bash_command, '{{ task_instance_key_str }}')
+
+ url = ('rendered?task_id=testtask&dag_id=testdag&execution_date={}'
+ .format(self.percent_encode(self.default_date)))
+
+ resp = self.client.get(url, follow_redirects=True)
+ self.check_content_in_response("testdag__testtask__20200301", resp)
Review comment:
So we attempt to render the fields anyway? Does this mean that using a
user-defined filter etc will just display nothing? Error?
This is possibly more confusing than not rendering the result at all.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services