tshallenberger commented on PR #32264:
URL: https://github.com/apache/superset/pull/32264#issuecomment-2674865478

   Sorry for the delayed update on the PR: @rusackas we weren't able to get 
advanced types to work for our particular use case, so I took the comments and 
revisited the code change. It's still a work in progress but I think the best 
approach is to simply add an extra config to `createMemoryFormatter` that 
specifies if it's a data transfer rate or not, and therefore appends the '/s' 
(since data transfer rates are usually specified in bits/bytes per second, I 
don't think we need to worry about supporting per minute or per hour). 
   
   so the final `setupFormatters.ts` would look kinda like:
   
   ```
   .registerValue('MEMORY_DECIMAL', createMemoryFormatter({ binary: false }))
   .registerValue('MEMORY_BINARY', createMemoryFormatter({ binary: true }))
   // new
   .registerValue('MEMORY_TRANSFER_RATE_DECIMAL', createMemoryFormatter({ 
binary: false, transfer: true }))
   .registerValue('MEMORY_TRANSFER_RATE_BINARY', createMemoryFormatter({ 
binary: true, transfer: true }))
   ```
   
   This way we heavily re-use the createMemoryFormatter and simplify things a 
bit. 
   
   @villebro Thoughts?


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