bito-code-review[bot] commented on PR #44460:
URL: https://github.com/apache/superset/pull/44460#issuecomment-5750200487

   <!-- Bito Reply -->
   The flagged issue is correct. The current implementation of 
`_apply_granularity` in `superset/common/query_context_factory.py` does not 
account for the possibility that the first temporal filter might be an 
independent filter on a different datetime column, rather than the one being 
replaced by the inferred granularity. To resolve this, you should verify that 
the filter being removed is indeed the one associated with the previous 
granularity or is redundant, rather than blindly removing the first temporal 
filter found in the query object's filter list.
   
   **superset/common/query_context_factory.py**
   ```
   # Instead of blindly removing the first temporal filter:
               # filter_to_remove = next((f for f in query_object.filter if 
f.get("col") == old_granularity), None)
               # if filter_to_remove:
               #     query_object.filter.remove(filter_to_remove)
   ```


-- 
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