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/12/02 20:21:22 UTC

[GitHub] [airflow] XD-DENG commented on a change in pull request #12764: Improve error handling in cli and introduce consistency

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



##########
File path: airflow/cli/commands/connection_command.py
##########
@@ -112,17 +112,13 @@ def _format_connections(conns: List[Connection], fmt: str) -> str:
 
 
 def _is_stdout(fileio: io.TextIOWrapper) -> bool:
-    if fileio.name == '<stdout>':
-        return True
-    return False
+    return fileio.name == '<stdout>'
 
 
 def _valid_uri(uri: str) -> bool:
     """Check if a URI is valid, by checking if both scheme and netloc are available"""
     uri_parts = urlparse(uri)
-    if uri_parts.scheme == '' or uri_parts.netloc == '':
-        return False
-    return True
+    return uri_parts.scheme != '' or uri_parts.netloc != ''

Review comment:
       This should be changed into `uri_parts.scheme != '' and uri_parts.netloc != ''`, instinct from a math-major guy ;-)




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