danepitkin commented on code in PR #34894:
URL: https://github.com/apache/arrow/pull/34894#discussion_r1160104046
##########
python/pyarrow/types.py:
##########
@@ -407,155 +223,71 @@ def is_unicode(t):
return is_string(t)
+@doc(is_null, datatype="string (utf8 unicode)")
def is_string(t):
- """
- Return True if value is an instance of string (utf8 unicode) type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_STRING
+@doc(is_unicode, method="is_large_string")
def is_large_unicode(t):
- """
- Alias for is_large_string.
-
- Parameters
- ----------
- t : DataType
- """
return is_large_string(t)
+@doc(is_null, datatype="large string (utf8 unicode)")
def is_large_string(t):
- """
- Return True if value is an instance of large string (utf8 unicode) type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_LARGE_STRING
+@doc(is_null, datatype="fixed size binary")
def is_fixed_size_binary(t):
- """
- Return True if value is an instance of a fixed size binary type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_FIXED_SIZE_BINARY
+@doc(is_null, datatype="date")
def is_date(t):
- """
- Return True if value is an instance of a date type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id in _DATE_TYPES
+@doc(is_null, datatype="date32 (days)")
def is_date32(t):
- """
- Return True if value is an instance of a date32 (days) type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_DATE32
+@doc(is_null, datatype="date64 (milliseconds)")
def is_date64(t):
- """
- Return True if value is an instance of a date64 (milliseconds) type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_DATE64
+@doc(is_null, datatype="logical map")
def is_map(t):
- """
- Return True if value is an instance of a map logical type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_MAP
+@doc(is_null, datatype="decimal")
def is_decimal(t):
- """
- Return True if value is an instance of a decimal type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id in _DECIMAL_TYPES
+@doc(is_null, datatype="decimal128")
def is_decimal128(t):
- """
- Return True if value is an instance of a decimal type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_DECIMAL128
+@doc(is_null, datatype="decimal256")
def is_decimal256(t):
- """
- Return True if value is an instance of a decimal type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_DECIMAL256
+@doc(is_null, datatype="dictionary-encoded")
def is_dictionary(t):
- """
- Return True if value is an instance of a dictionary-encoded type.
-
- Parameters
- ----------
- t : DataType
- """
return t.id == lib.Type_DICTIONARY
+@doc(is_null, datatype="interval")
def is_interval(t):
- """
- Return True if the value is an instance of an interval type.
-
- Parameters
- ----------
- t : DateType
- """
return t.id == lib.Type_INTERVAL_MONTH_DAY_NANO
+@doc(is_null, datatype="primitive")
Review Comment:
I chose `primitive type` since it's describing a family of types.
--
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]