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 2021/04/24 08:02:28 UTC

[GitHub] [airflow] XD-DENG commented on a change in pull request #15512: Add code style note: no asserts

XD-DENG commented on a change in pull request #15512:
URL: https://github.com/apache/airflow/pull/15512#discussion_r619607617



##########
File path: CONTRIBUTING.rst
##########
@@ -946,6 +946,23 @@ Most of our coding style rules are enforced programmatically by flake8 and pylin
 on every pull request), but there are some rules that are not yet automated and are more Airflow specific or
 semantic than style
 
+Using Asserts Outside Tests

Review comment:
       Maybe more explicit to say "`Don't Use Asserts Outside Tests`"?

##########
File path: CONTRIBUTING.rst
##########
@@ -946,6 +946,23 @@ Most of our coding style rules are enforced programmatically by flake8 and pylin
 on every pull request), but there are some rules that are not yet automated and are more Airflow specific or
 semantic than style
 
+Using Asserts Outside Tests
+---------------------------
+
+Our community agreed that to various reasons we **do not use ``assert`` in production code** of Apache Airflow.
+For details check the relevant [mailing list thread](https://lists.apache.org/thread.html/bcf2d23fcd79e21b3aac9f32914e1bf656e05ffbcb8aa282af497a2d%40%3Cdev.airflow.apache.org%3E).
+
+In other words instead of doing:
+
+.. code-block:: python

Review comment:
       The code example seems cannot be rendered properly ? Possibly due to the indentation.
   
   <img width="1081" alt="airflow_CONTRIBUTING_rst_at_09da71fee1778cf352741b0bcf7c4b7c4ce1fd30_ยท_apache_airflow" src="https://user-images.githubusercontent.com/11539188/115951977-f501cf00-a4e3-11eb-945a-3ee0cd9140ca.png">
   




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