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

   <!-- Bito Reply -->
   The suggestion to add a docstring to the `rename_deprecated_fields` method 
is correct, as it improves code maintainability and adheres to standard 
documentation practices for new methods. You can resolve this by adding a 
descriptive docstring directly above the method body.
   
   Here is the updated code snippet:
   
   ```python
       @post_load
       def rename_deprecated_fields(
           self, data: dict[str, Any], **kwargs: Any
       ) -> dict[str, Any]:
           """Remaps deprecated query keys to their replacement keys during 
schema post-processing."""
           _renames = (
               ("groupby", "columns"),
               ("granularity_sqla", "granularity"),
               ("timeseries_limit", "series_limit"),
               ("timeseries_limit_metric", "series_limit_metric"),
           )
           for old, new in _renames:
               if value := data.pop(old, None):
                   data[new] = value
           return data
   ```
   
   There are no other comments on this pull request to address.
   
   **superset/charts/schemas.py**
   ```
   @post_load
       def rename_deprecated_fields(
           self, data: dict[str, Any], **kwargs: Any
       ) -> dict[str, Any]:
           """Remaps deprecated query keys to their replacement keys during 
schema post-processing."""
           _renames = (
               ("groupby", "columns"),
               ("granularity_sqla", "granularity"),
               ("timeseries_limit", "series_limit"),
               ("timeseries_limit_metric", "series_limit_metric"),
           )
           for old, new in _renames:
               if value := data.pop(old, None):
                   data[new] = value
           return data
   ```


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