Skip to content

Commit 907945a

Browse files
committed
fix(tesseract): Fix member name case conversion
Prepend "_" even to the first UPPERCASE letter in the name
1 parent 644fbd4 commit 907945a

File tree

1 file changed

+11
-2
lines changed
  • rust/cubesqlplanner/cubesqlplanner/src/planner/sql_templates

1 file changed

+11
-2
lines changed

rust/cubesqlplanner/cubesqlplanner/src/planner/sql_templates/plan.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,17 @@ impl PlanSqlTemplates {
146146
Boundary::DIGIT_UPPER,
147147
Boundary::ACRONYM,
148148
])
149-
.to_case(Case::Snake)
150-
.replace(".", "__");
149+
.to_case(Case::Snake);
150+
151+
// For strange reasons, the javascript snake caser used in cube
152+
// changes first UPPERCASE letter to "_lowercase", prepending "_"
153+
// This is weird, but to be compatible we have to add it too.
154+
if let Some(fl) = name.chars().next() {
155+
if fl.is_uppercase() {
156+
return format!("_{}", res);
157+
}
158+
}
159+
151160
res
152161
}
153162

0 commit comments

Comments
 (0)