File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
python/ray/serve/_private Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 39
39
except ImportError :
40
40
np = None
41
41
42
+ FILE_NAME_REGEX = r'[^a-zA-Z0-9_-]'
42
43
MESSAGE_PACK_OFFSET = 9
43
44
GENERATOR_COMPOSITION_NOT_SUPPORTED_ERROR = RuntimeError (
44
45
"Streaming deployment handle results cannot be passed to "
@@ -568,8 +569,8 @@ def get_component_file_name(
568
569
str: The formatted file name.
569
570
"""
570
571
# Sanitize component_name and component_id by replacing special characters with underscores
571
- component_name = re .sub (r'[^a-zA-Z0-9_-]' , '_' , component_name )
572
- component_id = re .sub (r'[^a-zA-Z0-9_-]' , '_' , component_id )
572
+ component_name = re .sub (FILE_NAME_REGEX , '_' , component_name )
573
+ component_id = re .sub (FILE_NAME_REGEX , '_' , component_id )
573
574
574
575
# For DEPLOYMENT component type, we want to log the deployment name
575
576
# instead of adding the component type to the component name.
You can’t perform that action at this time.
0 commit comments