You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2023/01/18 21:26:48 UTC

[GitHub] [superset] kevinmarsh commented on issue #20667: Show comment for ColumnElement/TableElement

kevinmarsh commented on issue #20667:
URL: https://github.com/apache/superset/issues/20667#issuecomment-1396108798

   So pulling an [example from the Django docs](https://docs.djangoproject.com/en/4.2/ref/models/fields/#enumeration-types):
   ```python
   class Card(models.Model):
   
       class Suit(models.IntegerChoices):
           DIAMOND = 1
           SPADE = 2
           HEART = 3
           CLUB = 4
   
       suit = models.IntegerField(choices=Suit.choices)
   ```
   
   The `suit` column is stored as an integer from `1`-`4` however you lose the context of what those integers represent when viewing the data in Superset.
   
   ---
   
   [Starting in Django 4.2](https://docs.djangoproject.com/en/dev/releases/4.2/#comments-on-columns-and-tables), you can provide both table and column comments which would be really valuable to expose in this view as a comment or tooltip
   
   ```diff
   suit = models.IntegerField(
   	choices=Suit.choices,
   +    db_comment="1 represents 'Diamond', 2 represents 'Spade', etc."
   )
   ```


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org