codeant-ai-for-open-source[bot] commented on code in PR #45108:
URL: https://github.com/apache/superset/pull/45108#discussion_r4232372534
##########
superset-core/src/superset_core/semantic_layers/view.py:
##########
@@ -44,6 +44,32 @@ class SemanticViewFeature(enum.Enum):
class SemanticView(ABC):
"""
Abstract base class for semantic views.
+
+ Implementations own translation and execution; the rules the host relies on
+ are fixed here so every provider agrees on them:
+
+ - **Member identity.** ``Metric.name`` and ``Dimension.name`` are the
stable
+ selection keys; ``verbose_name`` is display only and ``id`` is
+ provider-private. See
:class:`~superset_core.semantic_layers.types.Metric`.
+ A provider that changes what ``name`` means declares a new
+ :attr:`selection_identity_version`.
+ - **Grain variants.** Several dimension variants may share one ``name``, at
+ most one per ``(name, grain)``. See
+ :class:`~superset_core.semantic_layers.types.Grains` for the preference
+ the host applies, and for why grains must not be ordered by name.
Review Comment:
**Suggestion:** The host does not apply this grain preference consistently
yet; filters can resolve to an arbitrary variant, so providers relying on this
claim may return incorrect results.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes` ยท ๐ท๏ธ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=c362dcdf365b4633b81c3a35edd7b8cf&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=c362dcdf365b4633b81c3a35edd7b8cf&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-core/src/superset_core/semantic_layers/view.py
**Line:** 58:59
**Comment:**
*Api Mismatch: The host does not apply this grain preference
consistently yet; filters can resolve to an arbitrary variant, so providers
relying on this claim may return incorrect results.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45108&comment_hash=e811d4277bb30b528b9a5298c5e2d7735d9566cb1d34208898cb99e19cc465a8&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45108&comment_hash=e811d4277bb30b528b9a5298c5e2d7735d9566cb1d34208898cb99e19cc465a8&reaction=dislike'>๐</a>
##########
superset-core/src/superset_core/semantic_layers/view.py:
##########
@@ -44,6 +44,32 @@ class SemanticViewFeature(enum.Enum):
class SemanticView(ABC):
"""
Abstract base class for semantic views.
+
+ Implementations own translation and execution; the rules the host relies on
+ are fixed here so every provider agrees on them:
+
+ - **Member identity.** ``Metric.name`` and ``Dimension.name`` are the
stable
+ selection keys; ``verbose_name`` is display only and ``id`` is
+ provider-private. See
:class:`~superset_core.semantic_layers.types.Metric`.
+ A provider that changes what ``name`` means declares a new
+ :attr:`selection_identity_version`.
+ - **Grain variants.** Several dimension variants may share one ``name``, at
+ most one per ``(name, grain)``. See
+ :class:`~superset_core.semantic_layers.types.Grains` for the preference
+ the host applies, and for why grains must not be ordered by name.
+ - **NULL in filters.** ``None`` is never a comparison operand; splitting
+ nullness into ``IS_NULL``/``IS_NOT_NULL`` is the host's responsibility.
Review Comment:
**Suggestion:** The mapper currently passes `None` through with its original
operator, so providers relying on this statement may stop handling it and
silently drop matching rows.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=3b00ae7ab8374e968b6784d6224a7817&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=3b00ae7ab8374e968b6784d6224a7817&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-core/src/superset_core/semantic_layers/view.py
**Line:** 60:61
**Comment:**
*Api Mismatch: The mapper currently passes `None` through with its
original operator, so providers relying on this statement may stop handling it
and silently drop matching rows.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45108&comment_hash=26deeb5def13bdfa8149e946393a1abda548804933dee026b31488b1e741ea6c&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45108&comment_hash=26deeb5def13bdfa8149e946393a1abda548804933dee026b31488b1e741ea6c&reaction=dislike'>๐</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]