withnale commented on issue #32972:
URL: https://github.com/apache/superset/issues/32972#issuecomment-2772617513

   
   
   
   
   
   Similarly, if you look at a simple dashboard export you will see sections in 
the export similar to this:
   
   ```yaml
   
   position:
     CHART-2oF-uUdrSO:
       children: []
       id: CHART-2oF-uUdrSO
       meta:
         chartId: 392
         height: 20
         sliceName: My Wonderful Chart
         uuid: 812bc377-ac09-475a-8d34-a63f7f087bd7
         width: 2
       parents:
       - ROOT_ID
       - GRID_ID
       - ROW-DOiwK0ZZha
       type: CHART
     CHART-6c90Bu_yvV:
       children: []
       id: CHART-6c90Bu_yvV
       meta:
         chartId: 529
         height: 20
         sliceName: Another Wonderful Chart
         uuid: 5b738061-5575-4689-b8d1-267c699e456e
         width: 2
       parents:
       - ROOT_ID
       - GRID_ID
       - ROW-DOiwK0ZZha
       type: CHART
   ```
   
   However if we look at the export methods, the values `CHART-2oF-uUdrSO` and 
`CHART-6c90Bu_yvV` are generated by the following code snippet (from 
`superset/commands/dashboard/export.py` ):
   
   ```python
   def suffix(length: int = 8) -> str:
       return "".join(
           random.SystemRandom().choice(string.ascii_uppercase + string.digits)
           for _ in range(length)
       )
   
   def append_charts(position: dict[str, Any], charts: set[Slice]) -> dict[str, 
Any]:
       chart_hashes = [f"CHART-{suffix()}" for _ in charts]
   ```
   
   Is there an easy way to make this predictable? Considering at present a 
chart can only appear on a dashboard once, is there a downside to making this 
`CHART-{chart.uuid}` ?


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