Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-3910: [Python] Set date_as_objects=True as default in to_pandas…
… methods This does not add a deprecation warning primarily because it's a bit difficult to do (we would need to check the data types whether it's a date -- or in the case of a table, if any field is a date--, and then warn if so). `True` is the correct option though in order to accurately roundtrip data to and from pandas. Some users might have some workarounds floating around, but this is sufficiently advanced stuff already. With this patch, date data round trips with no special options ``` In [2]: import pyarrow as pa In [3]: import datetime In [4]: arr = pa.array([datetime.date(2000, 1, 1), None]) In [5]: arr Out[5]: <pyarrow.lib.Date32Array object at 0x0000022CCDB1BBD8> [ 10957, null ] In [6]: arr.to_pandas() Out[6]: array([datetime.date(2000, 1, 1), None], dtype=object) In [7]: pa.array(arr.to_pandas()) Out[7]: <pyarrow.lib.Date32Array object at 0x0000022CCDC7FE58> [ 10957, null ] ``` If others strongly feel it's worth going to the effort of raising a deprecation warning, please chime in. Author: Wes McKinney <wesm+git@apache.org> Closes #3272 from wesm/ARROW-3910 and squashes the following commits: 308afe5 <Wes McKinney> Add Windows makefile for Sphinx, add section about date conversions to pandas.rst f77c296 <Wes McKinney> Set date_as_objects=True as default in to_pandas methods
- Loading branch information
Showing
7 changed files
with
231 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@rem Licensed to the Apache Software Foundation (ASF) under one | ||
@rem or more contributor license agreements. See the NOTICE file | ||
@rem distributed with this work for additional information | ||
@rem regarding copyright ownership. The ASF licenses this file | ||
@rem to you under the Apache License, Version 2.0 (the | ||
@rem "License"); you may not use this file except in compliance | ||
@rem with the License. You may obtain a copy of the License at | ||
@rem | ||
@rem http://www.apache.org/licenses/LICENSE-2.0 | ||
@rem | ||
@rem Unless required by applicable law or agreed to in writing, | ||
@rem software distributed under the License is distributed on an | ||
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
@rem KIND, either express or implied. See the License for the | ||
@rem specific language governing permissions and limitations | ||
@rem under the License. | ||
|
||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=_build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.. Licensed to the Apache Software Foundation (ASF) under one | ||
.. or more contributor license agreements. See the NOTICE file | ||
.. distributed with this work for additional information | ||
.. regarding copyright ownership. The ASF licenses this file | ||
.. to you under the Apache License, Version 2.0 (the | ||
.. "License"); you may not use this file except in compliance | ||
.. with the License. You may obtain a copy of the License at | ||
.. http://www.apache.org/licenses/LICENSE-2.0 | ||
.. Unless required by applicable law or agreed to in writing, | ||
.. software distributed under the License is distributed on an | ||
.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
.. KIND, either express or implied. See the License for the | ||
.. specific language governing permissions and limitations | ||
.. under the License. | ||
Building the Documentation | ||
========================== | ||
|
||
Prerequisites | ||
------------- | ||
|
||
The documentation build process uses `Doxygen <http://www.doxygen.nl/>`_ and | ||
`Sphinx <http://www.sphinx-doc.org/>`_ along with a few extensions. | ||
|
||
If you're using Conda, the required software can be installed in a single line: | ||
|
||
.. code-block:: shell | ||
conda install -c conda-forge --file ci/conda_env_sphinx.yml | ||
Otherwise, you'll first need to install `Doxygen <http://www.doxygen.nl/>`_ | ||
yourself (for example from your distribution's official repositories, if | ||
using Linux). Then you can install the Python-based requirements with the | ||
following command: | ||
|
||
.. code-block:: shell | ||
pip install -r docs/requirements.txt | ||
Building | ||
-------- | ||
|
||
.. note:: | ||
|
||
If you are building the documentation on Windows, not all sections | ||
may build properly. | ||
|
||
These two steps are mandatory and must be executed in order. | ||
|
||
#. Process the C++ API using Doxygen | ||
|
||
.. code-block:: shell | ||
pushd cpp/apidoc | ||
doxygen | ||
popd | ||
#. Build the complete documentation using Sphinx | ||
|
||
.. code-block:: shell | ||
pushd docs | ||
make html | ||
popd | ||
After these steps are completed, the documentation is rendered in HTML | ||
format in ``docs/_build/html``. In particular, you can point your browser | ||
at ``docs/_build/html/index.html`` to read the docs and review any changes | ||
you made. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.