MCPcopy Create free account
hub / github.com/apache/arrow / _get_simple_index_descriptor

Function _get_simple_index_descriptor

python/pyarrow/pandas_compat.py:306–323  ·  view source on GitHub ↗
(level, name)

Source from the content-addressed store, hash-verified

304
305
306def _get_simple_index_descriptor(level, name):
307 string_dtype, extra_metadata = get_extension_dtype_info(level)
308 pandas_type = get_logical_type_from_numpy(level)
309 if 'mixed' in pandas_type:
310 warnings.warn(
311 "The DataFrame has column names of mixed type. They will be "
312 "converted to strings and not roundtrip correctly.",
313 UserWarning, stacklevel=4)
314 if pandas_type == 'unicode':
315 assert not extra_metadata
316 extra_metadata = {'encoding': 'UTF-8'}
317 return {
318 'name': name,
319 'field_name': name,
320 'pandas_type': pandas_type,
321 'numpy_type': string_dtype,
322 'metadata': extra_metadata,
323 }
324
325
326def _column_name_to_strings(name):

Callers 1

construct_metadataFunction · 0.85

Calls 2

get_extension_dtype_infoFunction · 0.85

Tested by

no test coverage detected