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/03/09 12:07:29 UTC

[GitHub] [airflow] ashb commented on a change in pull request #7658: [AIRFLOW-6443]Increase pool name length to 256, make cli give error if name is too long

ashb commented on a change in pull request #7658: [AIRFLOW-6443]Increase pool name length to 256, make cli give error if name is too long
URL: https://github.com/apache/airflow/pull/7658#discussion_r389618856
 
 

 ##########
 File path: airflow/api/common/experimental/pool.py
 ##########
 @@ -51,6 +51,11 @@ def create_pool(name, slots, description, session=None):
     except ValueError:
         raise AirflowBadRequest("Bad value for `slots`: %s" % slots)
 
+    # 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 shouldn't be more than %s characters" % pool_name_length)
 
 Review comment:
   ```suggestion
           raise AirflowBadRequest("Pool name can't be more than %d characters" % pool_name_length)
   ```

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


With regards,
Apache Git Services