codeant-ai-for-open-source[bot] commented on code in PR #41391:
URL: https://github.com/apache/superset/pull/41391#discussion_r3536730605


##########
superset/models/helpers.py:
##########
@@ -2912,6 +2912,18 @@ def get_time_filter(  # pylint: 
disable=too-many-arguments
             )
         )
 
+        # Honor the dataset "Hour Offset". Result timestamps are displayed 
shifted
+        # by +offset hours (see normalize_df / DateColumn in 
superset.utils.core),
+        # but the time filter compares the raw stored values. Shifting the 
filter
+        # bounds by -offset keeps the filter consistent with what is displayed;
+        # otherwise a date selection lands on the wrong calendar day (#104810).
+        offset_hours = getattr(self, "offset", 0) or 0

Review Comment:
   **Suggestion:** Add an explicit type annotation to this newly introduced 
local variable so the added logic complies with required type hints. 
[custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The added local variable is a new Python variable introduced in the hunk and 
it clearly has an integer type, so it can be annotated (for example, 
`offset_hours: int = ...`). Since the custom rule requires type hints on 
relevant annotatable variables, this is a real rule violation.
   </details>
   <details>
   <summary><b>Rule source 📖 </b></summary>
   
   .cursor/rules/dev-standard.mdc (line 28)
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=a4e7cd8e6709406db022b3512d816161&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=a4e7cd8e6709406db022b3512d816161&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/models/helpers.py
   **Line:** 2920:2920
   **Comment:**
        *Custom Rule: Add an explicit type annotation to this newly introduced 
local variable so the added logic complies with required type hints.
   
   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%2F41391&comment_hash=955a2cc4cba97bcec9ee27f5233771441db671d5e3675815f5c8d0f88747f2e4&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41391&comment_hash=955a2cc4cba97bcec9ee27f5233771441db671d5e3675815f5c8d0f88747f2e4&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]

Reply via email to