Spaces:
Runtime error
Runtime error
clementsan
commited on
Commit
•
08108c1
1
Parent(s):
9bf736d
Fix collection name minimum length
Browse files
app.py
CHANGED
@@ -193,8 +193,11 @@ def create_collection_name(filepath):
|
|
193 |
## Remove special characters
|
194 |
#collection_name = re.findall("[\dA-Za-z]*", collection_name)[0]
|
195 |
collection_name = re.sub('[^A-Za-z0-9]+', '-', collection_name)
|
196 |
-
## Limit
|
197 |
collection_name = collection_name[:50]
|
|
|
|
|
|
|
198 |
print('Filepath: ', filepath)
|
199 |
print('Collection name: ', collection_name)
|
200 |
return collection_name
|
|
|
193 |
## Remove special characters
|
194 |
#collection_name = re.findall("[\dA-Za-z]*", collection_name)[0]
|
195 |
collection_name = re.sub('[^A-Za-z0-9]+', '-', collection_name)
|
196 |
+
## Limit length to 50 characters
|
197 |
collection_name = collection_name[:50]
|
198 |
+
## Minimum length of 3 characters
|
199 |
+
if len(collection_name) < 3:
|
200 |
+
collection_name = collection_name + 'xyz'
|
201 |
print('Filepath: ', filepath)
|
202 |
print('Collection name: ', collection_name)
|
203 |
return collection_name
|