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 2020/06/15 13:09:38 UTC

[GitHub] [airflow] mik-laj opened a new pull request #9307: Fix failing master - Invalid assertion in conf

mik-laj opened a new pull request #9307:
URL: https://github.com/apache/airflow/pull/9307


   ---
   Make sure to mark the boxes below before creating PR: [x]
   
   - [ ] Description above provides context of the change
   - [ ] Unit tests coverage for changes (not needed for documentation changes)
   - [ ] Target Github ISSUE in description if exists
   - [ ] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [ ] Relevant documentation is updated including usage instructions.
   - [ ] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#discussion_r440172299



##########
File path: tests/www/test_views.py
##########
@@ -627,11 +627,11 @@ def test_view_uses_existing_dagbag(self, endpoint, mock_get_dag):
         self.check_content_in_response('example_bash_operator', resp)
 
     @parameterized.expand([
-        ("hello\nworld", "hello\\\\nworld"),
-        ("hello'world", "hello\\\\u0027world"),
-        ("<script>", "\\\\u003cscript\\\\u003e"),
+        ("hello\nworld", r'"conf":{"abc":"hello\nworld"}}'),
+        ("hello'world", r'"conf":{"abc":"hello\u0027world"}}'),
+        ("<script>", r'"conf":{"abc":"\u003cscript\u003e"}}'),

Review comment:
       I added this case.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#discussion_r440165138



##########
File path: airflow/www/templates/airflow/tree.html
##########
@@ -136,7 +136,7 @@
 
 var devicePixelRatio = window.devicePixelRatio || 1;
 // JSON.parse is faster for large payloads than an object literal (because the JSON grammer is simpler!)
-var data = JSON.parse({{ data|tojson }});
+var data = {{ data }};

Review comment:
       Correct. This was added for a reason. As it says in the comment directly before this line.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj merged pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #9307:
URL: https://github.com/apache/airflow/pull/9307


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb commented on pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#issuecomment-644127488


   @mik-laj @Khrol Would one of you be able to update the test runner to run tests in case of template changes too please?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#discussion_r440165210



##########
File path: airflow/www/templates/airflow/tree.html
##########
@@ -136,7 +136,7 @@
 
 var devicePixelRatio = window.devicePixelRatio || 1;
 // JSON.parse is faster for large payloads than an object literal (because the JSON grammer is simpler!)
-var data = JSON.parse({{ data|tojson }});
+var data = {{ data }};

Review comment:
       Okay. I will correct it. Thanks for your vigilance.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] Khrol commented on a change in pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
Khrol commented on a change in pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#discussion_r440165700



##########
File path: tests/www/test_views.py
##########
@@ -627,11 +627,11 @@ def test_view_uses_existing_dagbag(self, endpoint, mock_get_dag):
         self.check_content_in_response('example_bash_operator', resp)
 
     @parameterized.expand([
-        ("hello\nworld", "hello\\\\nworld"),
-        ("hello'world", "hello\\\\u0027world"),
-        ("<script>", "\\\\u003cscript\\\\u003e"),
+        ("hello\nworld", r'"conf":{"abc":"hello\nworld"}}'),
+        ("hello'world", r'"conf":{"abc":"hello\u0027world"}}'),
+        ("<script>", r'"conf":{"abc":"\u003cscript\u003e"}}'),

Review comment:
       Can we add `{"\"": ""}` test here? I'm not sure if this PR still keeps the original bug fix.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj edited a comment on pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#issuecomment-644135284


   > @mik-laj @Khrol Would one of you be able to update the test runner to run tests in case of template changes too please?
   
   I'm too busy to do it now. @Khrol Can you help with it?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] Khrol commented on a change in pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
Khrol commented on a change in pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#discussion_r440165700



##########
File path: tests/www/test_views.py
##########
@@ -627,11 +627,11 @@ def test_view_uses_existing_dagbag(self, endpoint, mock_get_dag):
         self.check_content_in_response('example_bash_operator', resp)
 
     @parameterized.expand([
-        ("hello\nworld", "hello\\\\nworld"),
-        ("hello'world", "hello\\\\u0027world"),
-        ("<script>", "\\\\u003cscript\\\\u003e"),
+        ("hello\nworld", r'"conf":{"abc":"hello\nworld"}}'),
+        ("hello'world", r'"conf":{"abc":"hello\u0027world"}}'),
+        ("<script>", r'"conf":{"abc":"\u003cscript\u003e"}}'),

Review comment:
       Can we add `{"\"": ""}` test here?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] Khrol commented on a change in pull request #9307: Fix failing master - Invalid assertion in conf

Posted by GitBox <gi...@apache.org>.
Khrol commented on a change in pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#discussion_r440164588



##########
File path: airflow/www/templates/airflow/tree.html
##########
@@ -136,7 +136,7 @@
 
 var devicePixelRatio = window.devicePixelRatio || 1;
 // JSON.parse is faster for large payloads than an object literal (because the JSON grammer is simpler!)
-var data = JSON.parse({{ data|tojson }});
+var data = {{ data }};

Review comment:
       I think we should not remove `JSON.parse` with `tojson` due to performance problems (see comment above).




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#issuecomment-644135284


   > @mik-laj @Khrol Would one of you be able to update the test runner to run tests in case of template changes too please?
   
   I'm too busy to do it now. 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #9307: Fix failing tests from #9250

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9307:
URL: https://github.com/apache/airflow/pull/9307#discussion_r440172464



##########
File path: airflow/www/templates/airflow/tree.html
##########
@@ -136,7 +136,7 @@
 
 var devicePixelRatio = window.devicePixelRatio || 1;
 // JSON.parse is faster for large payloads than an object literal (because the JSON grammer is simpler!)
-var data = JSON.parse({{ data|tojson }});
+var data = {{ data }};

Review comment:
       I added JSON.parse.




----------------------------------------------------------------
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:
users@infra.apache.org