def _str_len(self): # utf8_length added in pyarrow 4.0.0 if hasattr(pc, "utf8_length"): result = pc.utf8_length(self._data) return Int64Dtype().__from_arrow__(result) else: return super()._str_len()
def _str_len(self): if pa_version_under4p0: fallback_performancewarning(version="4") return super()._str_len() result = pc.utf8_length(self._data) return Int64Dtype().__from_arrow__(result)
def _str_len(self): if pa_version_under4p0: return super()._str_len() result = pc.utf8_length(self._data) return Int64Dtype().__from_arrow__(result)
def my_string_length(arr, **kwargs): # arr is a pyarrow.StringArray return pc.cast(pc.multiply(pc.utf8_length(arr), 2), target_type='int64')