From d3a1639d1a2af03bcfd9b76e634cbecac1be0cb0 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Thu, 5 Oct 2017 12:52:50 -0400 Subject: [PATCH 1/3] DOC: Column indexes should use the same metadata as columns --- doc/source/developer.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/source/developer.rst b/doc/source/developer.rst index a695366d9ada3..2076959761ce9 100644 --- a/doc/source/developer.rst +++ b/doc/source/developer.rst @@ -46,12 +46,12 @@ So that a ``pandas.DataFrame`` can be faithfully reconstructed, we store a {'index_columns': ['__index_level_0__', '__index_level_1__', ...], 'column_index_names': [, , ...], - 'column_index_dtypes': [, , ..., ] + 'column_indexes': [, , ..., ], 'columns': [, , ...], 'pandas_version': $VERSION} -Here, ```` and so forth are dictionaries containing the metadata for each -column. This has JSON form: +Here, ````/```` and so forth are dictionaries containing the metadata +for each column. This has JSON form: .. code-block:: text @@ -108,8 +108,12 @@ As an example of fully-formed metadata: .. code-block:: text {'index_columns': ['__index_level_0__'], - 'column_index_names': [None], - 'column_index_dtypes': ['object'], + 'column_indexes': [ + {'name': None, + 'pandas_type': 'string', + 'numpy_type': 'object', + 'type_metadata': None} + ], 'columns': [ {'name': 'c0', 'pandas_type': 'int8', From 418f173533b5ed373eeebf766c7cc30f4a656642 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Thu, 5 Oct 2017 12:55:25 -0400 Subject: [PATCH 2/3] Fix metadata field name --- doc/source/developer.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/developer.rst b/doc/source/developer.rst index 2076959761ce9..8cb035e763f6d 100644 --- a/doc/source/developer.rst +++ b/doc/source/developer.rst @@ -58,7 +58,7 @@ for each column. This has JSON form: {'name': column_name, 'pandas_type': pandas_type, 'numpy_type': numpy_type, - 'metadata': type_metadata} + 'metadata': metadata} ``pandas_type`` is the logical type of the column, and is one of: @@ -75,7 +75,7 @@ result of ``str(dtype)`` for the underlying NumPy array that holds the data. So for ``datetimetz`` this is ``datetime64[ns]`` and for categorical, it may be any of the supported integer categorical types. -The ``type_metadata`` is ``None`` except for: +The ``metadata`` field is ``None`` except for: * ``datetimetz``: ``{'timezone': zone, 'unit': 'ns'}``, e.g. ``{'timezone', 'America/New_York', 'unit': 'ns'}``. The ``'unit'`` is optional, and if @@ -112,7 +112,7 @@ As an example of fully-formed metadata: {'name': None, 'pandas_type': 'string', 'numpy_type': 'object', - 'type_metadata': None} + 'metadata': None} ], 'columns': [ {'name': 'c0', From b0d34cf02b4a655a51a77d389e4e8e32eedf1512 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Thu, 5 Oct 2017 12:59:28 -0400 Subject: [PATCH 3/3] Remove column_index_names --- doc/source/developer.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/developer.rst b/doc/source/developer.rst index 8cb035e763f6d..9c214020ab43d 100644 --- a/doc/source/developer.rst +++ b/doc/source/developer.rst @@ -45,7 +45,6 @@ So that a ``pandas.DataFrame`` can be faithfully reconstructed, we store a .. code-block:: text {'index_columns': ['__index_level_0__', '__index_level_1__', ...], - 'column_index_names': [, , ...], 'column_indexes': [, , ..., ], 'columns': [, , ...], 'pandas_version': $VERSION}