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

   <!-- Bito Reply -->
   The flagged issue is correct. The `aggregation` field is currently accepted 
in `BigNumberChartConfig` without verifying that `show_trendline` is enabled, 
leading to silent failures where the configuration is ignored. To resolve this, 
you should add a Pydantic `model_validator` to `BigNumberChartConfig` in 
`superset/mcp_service/chart/schemas.py` that enforces this dependency.
   
   Here is the implementation for the validator:
   
   ```python
   from pydantic import model_validator
   
   # Inside BigNumberChartConfig class:
   @model_validator(mode="after")
   def validate_aggregation_requires_trendline(self) -> "BigNumberChartConfig":
       if self.aggregation is not None and not self.show_trendline:
           raise ValueError("aggregation requires show_trendline=True")
       return self
   ```
   
   I have checked the PR comments, and there are no other pending review 
comments to address. Would you like me to proceed with any other changes?
   
   **superset/mcp_service/chart/schemas.py**
   ```
   @model_validator(mode="after")
       def validate_aggregation_requires_trendline(self) -> 
"BigNumberChartConfig":
           if self.aggregation is not None and not self.show_trendline:
               raise ValueError("aggregation requires show_trendline=True")
           return self
   ```


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