Skip to content
Snippets Groups Projects

Fix name in group join

Merged Chosson Ulysse requested to merge FIX_name_in_group_join into dev
6 files
+ 35
4
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -17,7 +17,7 @@ from ..utils.classes.magicdotpath import (
from ..utils.classes.other_classes import Command, SQLEnumerableData
from ..utils.functions.aggregate_functions import get_aggregate
from ..utils.functions.join_functions import join_get_intersect, join_get_paths
from ..utils.functions.other_functions import get_columns_name
from ..utils.functions.other_functions import _col_name_validator, get_columns_name
from ..utils.functions.path_functions import get_path
from ..utils.functions.predicate_functions import get_one_predicate_as_str
from .consult_context import build_order_by, build_where, define_limit_offset
@@ -277,7 +277,9 @@ def _get_selected_by(
by.append(get_path(value)[0])
mdp_for_names[key] = value
case MagicDotPathAggregate():
selected.append(get_aggregate(value))
selected.append(
f"{get_aggregate(value)} AS {_col_name_validator(key)}"
)
case _:
raise TypeError(
"_get_selected_by take only MagicDotPath, "
Loading