Skip to content

Commit fccd8a2

Browse files
committed
updated _translate_sheet_name(): substitute special characters by underscores in sheet_name if it is a string and not only a Group
1 parent 7947c6e commit fccd8a2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

larray/core/group.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,11 @@ def _to_keys(value, stack_depth=1):
654654

655655
def _translate_sheet_name(sheet_name):
656656
if isinstance(sheet_name, Group):
657-
sheet_name = _sheet_name_pattern.sub('_', str(_to_tick(sheet_name)))
658-
if isinstance(sheet_name, basestring) and len(sheet_name) > 30:
659-
raise ValueError("Sheet names cannot exceed 31 characters")
657+
sheet_name = str(_to_tick(sheet_name))
658+
if isinstance(sheet_name, basestring):
659+
sheet_name = _sheet_name_pattern.sub('_', sheet_name)
660+
if len(sheet_name) > 30:
661+
raise ValueError("Sheet names cannot exceed 31 characters")
660662
return sheet_name
661663

662664

0 commit comments

Comments
 (0)