SIENTIAPDE-1445
Refactor camelCase conversion in prepare_worker.py to snake_case for consistency in queue naming. Updated function name and logic accordingly.
This commit is contained in:
@@ -21,10 +21,10 @@ parameters = [
|
||||
]
|
||||
|
||||
|
||||
def camel_to_kebab(text: str) -> str:
|
||||
"""Convert camelCase or PascalCase to kebab-case."""
|
||||
text = re.sub('(.)([A-Z][a-z]+)', r'\1-\2', text)
|
||||
text = re.sub('([a-z0-9])([A-Z])', r'\1-\2', text)
|
||||
def camel_to_snake(text: str) -> str:
|
||||
"""Convert camelCase or PascalCase to snake_case."""
|
||||
text = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
|
||||
text = re.sub('([a-z0-9])([A-Z])', r'\1_\2', text)
|
||||
return text.lower()
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ def prepare_worker(
|
||||
) -> Worker:
|
||||
main_workflow_name = main_workflow.__name__.upper()
|
||||
|
||||
queue_name = f'{camel_to_kebab(main_workflow.__name__)}-queue'
|
||||
queue_name = f'{camel_to_snake(main_workflow.__name__)}_queue'
|
||||
|
||||
local_workflow_parameters = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user