Skip to content

Commit 8c1a585

Browse files
committed
Reversed to_snake_case() code
1 parent 4dee400 commit 8c1a585

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pyatlan/model/utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ def to_snake_case(value):
4545
return "purpose_atlan_tags"
4646
elif value == "mappedClassificationName":
4747
return "mapped_atlan_tag_name"
48-
49-
value = value.replace("URL", "Url").replace("DBT", "Dbt").replace("GDPR", "Gdpr")
50-
5148
res = [value[0].lower()]
52-
for c in value[1:]:
49+
for c in (
50+
value.replace("URL", "Url").replace("DBT", "Dbt").replace("GDPR", "Gdpr")[1:]
51+
):
5352
if c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
5453
res.append("_")
5554
res.append(c.lower())
5655
else:
5756
res.append(c)
58-
5957
return "".join(res).replace(" _", "_").replace(" ", "_")

0 commit comments

Comments
 (0)