Skip to content

Commit f37e446

Browse files
bozhou8bo-zhou-ms
andauthored
Fix model bpa rules (#392)
Co-authored-by: Bo Zhou <zhoubo@microsoft.com>
1 parent 3c9f579 commit f37e446

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sempy_labs/_model_bpa_rules.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def model_bpa_rules(
6464
obj.FromCardinality == TOM.RelationshipEndCardinality.Many
6565
and obj.ToCardinality == TOM.RelationshipEndCardinality.Many
6666
)
67-
or str(obj.CrossFilteringBehavior) == "BothDirections"
67+
or str(obj.CrossFilteringBehavior) == "BothDirections",
6868
"Bi-directional and many-to-many relationships may cause performance degradation or even have unintended consequences. Make sure to check these specific relationships to ensure they are working as designed and are actually necessary.",
6969
"https://www.sqlbi.com/articles/bidirectional-relationships-and-ambiguity-in-dax",
7070
),
@@ -402,8 +402,8 @@ def model_bpa_rules(
402402
lambda obj, tom: tom.is_direct_lake() is False
403403
and obj.IsAvailableInMDX is False
404404
and (
405-
tom.used_in_sort_by(column=obj)
406-
or tom.used_in_hierarchies(column=obj)
405+
any(tom.used_in_sort_by(column=obj))
406+
or any(tom.used_in_hierarchies(column=obj))
407407
or obj.SortByColumn is not None
408408
),
409409
"In order to avoid errors, ensure that attribute hierarchies are enabled if a column is used for sorting another column, used in a hierarchy, used in variations, or is sorted by another column. The IsAvailableInMdx property is not relevant for Direct Lake models.",

0 commit comments

Comments
 (0)