korbit-ai[bot] commented on code in PR #31770:
URL: https://github.com/apache/superset/pull/31770#discussion_r1911632338


##########
superset/charts/client_processing.py:
##########
@@ -178,11 +182,20 @@ def pivot_df(  # pylint: disable=too-many-locals, 
too-many-arguments, too-many-s
     if rows and show_columns_total:
         # add subtotal for each group and overall total; we start from the
         # overall group, and iterate deeper into subgroups
-        groups = df.index
+        groups = df.index.copy()

Review Comment:
   ### Unnecessary Index Copy <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The index copy is unnecessary since get_loc() is used only for lookup and 
doesn't modify the index.
   
   ###### Why this matters
   Creates a redundant copy of the index in memory without providing any 
functional benefit, as the operation is read-only.
   
   ###### Suggested change ∙ *Feature Preview*
   Remove the .copy() call:
   ```python
   groups = df.index
   ```
   
   
   </details>
   
   ###### Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help 
Korbit improve your reviews.
   
   <!--- korbi internal id:88c0c37d-434a-49c4-9379-2234b8edc6c2 -->
   



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