Skip to content

Commit 1ac87c9

Browse files
committed
refactor: use VLP_CTE_FROM_ALIAS constant instead of hardcoded 't'
Addresses Copilot review feedback: replace magic string with named constant for better maintainability.
1 parent 9af7478 commit 1ac87c9

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/render_plan/plan_builder_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4419,9 +4419,9 @@ pub(crate) fn rewrite_vlp_union_branch_aliases(
44194419
let path_function_mappings: HashMap<String, String> = filtered_mappings
44204420
.iter()
44214421
.filter(|(from_alias, _to_alias)| {
4422-
// Only keep "t" mapping (for path functions like length(path))
4422+
// Only keep VLP_CTE_FROM_ALIAS mapping (for path functions like length(path))
44234423
// Exclude endpoint node aliases
4424-
*from_alias == "t"
4424+
*from_alias == VLP_CTE_FROM_ALIAS
44254425
})
44264426
.map(|(k, v)| (k.clone(), v.clone()))
44274427
.collect();

src/server/query_context.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,7 @@ mod tests {
329329
async fn test_denormalized_aliases() {
330330
with_query_context(QueryContext::empty(), async {
331331
register_denormalized_alias("d", "r2");
332-
assert_eq!(
333-
get_denormalized_alias_mapping("d"),
334-
Some("r2".to_string())
335-
);
332+
assert_eq!(get_denormalized_alias_mapping("d"), Some("r2".to_string()));
336333
assert_eq!(get_denormalized_alias_mapping("unknown"), None);
337334
})
338335
.await;

0 commit comments

Comments
 (0)