You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "randolf-scholz (via GitHub)" <gi...@apache.org> on 2023/05/13 07:52:43 UTC

[GitHub] [arrow] randolf-scholz commented on pull request #35210: GH-35209: [Python] Add a type alias for pa.dictionary(pa.int32(), pa.string())

randolf-scholz commented on PR #35210:
URL: https://github.com/apache/arrow/pull/35210#issuecomment-1546589412

   @danepitkin I'd add `dictionary[string,int32]` since it is likely the most common one. Maybe one should add `dictionary[int8,string]`, `dictionary[int16,string]` and `dictionary[int64,string]` immediately as well? How common are non-string dictionaries anyway?
   
   If all possible combinations with non-string types are needed one could write a custom lookup instead. 
   
   Regarding the representation one could do either:
   
   - differentiate `DictionaryType.__repr__` and `DictionaryType.__str__`, so that the latter returns the type-code
   - add an additional `name` / `type_code` property to each dtype that returns the abbreviated type code
       - for example, numpy has `name` attribute
       - `np.dtype("int32").name` ⇝ "int32"
       - `np.dtype("datetime64[ns]").name` ⇝ "datetime64[ns]"
   


-- 
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: github-unsubscribe@arrow.apache.org

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