jorisvandenbossche commented on a change in pull request #11196:
URL: https://github.com/apache/arrow/pull/11196#discussion_r712805526



##########
File path: python/pyarrow/types.pxi
##########
@@ -2446,8 +2446,11 @@ cpdef DictionaryType dictionary(index_type, value_type, 
bint ordered=False):
         DictionaryType out = DictionaryType.__new__(DictionaryType)
         shared_ptr[CDataType] dict_type
 
-    if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:
-        raise TypeError("The dictionary index type should be signed integer.")
+    if _index_type.id not in {
+        Type_INT8, Type_INT16, Type_INT32, Type_INT64,
+        Type_UINT8, Type_UINT16, Type_UINT32, Type_UINT64,

Review comment:
       This set is actually pre-defined, but in the python wrapper:
   
   
https://github.com/apache/arrow/blob/6a6b4643611f34cac8c829e9dc41eb6e815abd7b/python/pyarrow/types.py#L28-L32
   
   Instead of repeating it here, I could also move those set definitions to the 
cython file.




-- 
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-unsubscr...@arrow.apache.org

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


Reply via email to