You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/11/20 16:35:59 UTC

[airflow] branch main updated: refactor: f-string and comment update (#19721)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 9517342  refactor: f-string and comment update (#19721)
9517342 is described below

commit 9517342b727b977bcc7a99197c802bc084584c5d
Author: nhankiet <nh...@gmail.com>
AuthorDate: Sun Nov 21 03:35:30 2021 +1100

    refactor: f-string and comment update (#19721)
    
    _ Update the f-string for the case when pool_name_length exceed, for coherent and consistent of the file.
    _ Fix the docstring grammar  """Create a pool with a given parameters.""" -> """Create a pool with given parameters."""
---
 airflow/api/common/experimental/pool.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/api/common/experimental/pool.py b/airflow/api/common/experimental/pool.py
index 30950ea..4d7562b 100644
--- a/airflow/api/common/experimental/pool.py
+++ b/airflow/api/common/experimental/pool.py
@@ -42,7 +42,7 @@ def get_pools(session=None):
 
 @provide_session
 def create_pool(name, slots, description, session=None):
-    """Create a pool with a given parameters."""
+    """Create a pool with given parameters."""
     if not (name and name.strip()):
         raise AirflowBadRequest("Pool name shouldn't be empty")
 
@@ -54,7 +54,7 @@ def create_pool(name, slots, description, session=None):
     # Get the length of the pool column
     pool_name_length = Pool.pool.property.columns[0].type.length
     if len(name) > pool_name_length:
-        raise AirflowBadRequest("Pool name can't be more than %d characters" % pool_name_length)
+        raise AirflowBadRequest(f"Pool name can't be more than {pool_name_length} characters")
 
     session.expire_on_commit = False
     pool = session.query(Pool).filter_by(pool=name).first()