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

   <!-- Bito Reply -->
   The flagged issue is correct. The `generate_explore_link` function now 
defaults to returning a permalink URL, which lacks the `form_data_key` query 
parameter expected by existing callers like `update_chart_preview` and 
`generate_chart`. This causes those callers to fail when they attempt to 
extract the key.
   
   To resolve this, you can update `generate_explore_link` to accept an 
optional `force_form_data_key` parameter. When set to `True`, the function will 
skip the permalink generation and proceed directly to the `form_data_key` path, 
preserving the expected contract for legacy callers.
   
   Would you like me to implement this change and check the rest of the 
comments on this PR?
   
   **superset/mcp_service/chart/chart_utils.py**
   ```
   def generate_explore_link(dataset_id: int | str, form_data: Dict[str, Any], 
force_form_data_key: bool = False) -> str:
       # ...
       if not force_form_data_key:
           try:
               state = {"formData": form_data_with_datasource}
               permalink_key = CreateExplorePermalinkCommand(state=state).run()
               return f"{base_url}/explore/p/{permalink_key}/"
           except (ExplorePermalinkCreateFailedError, SQLAlchemyError) as 
permalink_e:
               # ...
   ```


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