diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b40d46bdebe02..9238c27002337 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,6 +5,7 @@ jobs: parameters: name: macOS vmImage: xcode9-macos10.13 + - template: ci/azure/posix.yml parameters: name: Linux @@ -134,7 +135,10 @@ jobs: - script: | export PATH=$HOME/miniconda3/bin:$PATH source activate pandas-dev - doc/make.py + # Next we should simply have `doc/make.py --warnings-are-errors`, everything else is required because the ipython directive doesn't fail the build on errors (https://github.com/ipython/ipython/issues/11547) + doc/make.py --warnings-are-errors | tee sphinx.log ; SPHINX_RET=${PIPESTATUS[0]} + grep -B1 "^<<<-------------------------------------------------------------------------$" sphinx.log ; IPY_RET=$(( $? != 1 )) + exit $(( $SPHINX_RET + $IPY_RET )) displayName: 'Build documentation' - script: | diff --git a/doc/source/getting_started/10min.rst b/doc/source/getting_started/10min.rst index fdf1f05b8e61f..8bb188419cb59 100644 --- a/doc/source/getting_started/10min.rst +++ b/doc/source/getting_started/10min.rst @@ -712,6 +712,7 @@ See the :ref:`Plotting ` docs. plt.close('all') .. ipython:: python + :okwarning: ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000)) diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index 725af8ef8769b..30a42de2ab287 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -3249,24 +3249,35 @@ And then import the data directly to a ``DataFrame`` by calling: .. code-block:: python - clipdf = pd.read_clipboard() - -.. ipython:: python - - clipdf - + >>> clipdf = pd.read_clipboard() + >>> clipdf + A B C + x 1 4 p + y 2 5 q + z 3 6 r The ``to_clipboard`` method can be used to write the contents of a ``DataFrame`` to the clipboard. Following which you can paste the clipboard contents into other applications (CTRL-V on many operating systems). Here we illustrate writing a ``DataFrame`` into clipboard and reading it back. -.. ipython:: python +.. code-block:: python - df = pd.DataFrame(np.random.randn(5, 3)) - df - df.to_clipboard() - pd.read_clipboard() + >>> df = pd.DataFrame({'A': [1, 2, 3], + ... 'B': [4, 5, 6], + ... 'C': ['p', 'q', 'r']}, + ... index=['x', 'y', 'z']) + >>> df + A B C + x 1 4 p + y 2 5 q + z 3 6 r + >>> df.to_clipboard() + >>> pd.read_clipboard() + A B C + x 1 4 p + y 2 5 q + z 3 6 r We can see that we got the same content back, which we had earlier written to the clipboard. diff --git a/doc/sphinxext/contributors.py b/doc/sphinxext/contributors.py index 179ba19a0908a..7794a24dad89b 100644 --- a/doc/sphinxext/contributors.py +++ b/doc/sphinxext/contributors.py @@ -21,12 +21,15 @@ class ContributorsDirective(Directive): def run(self): range_ = self.arguments[0] + if range_.endswith('x..HEAD'): + return [nodes.paragraph(), nodes.bullet_list()] try: components = build_components(range_) - except git.GitCommandError: + except git.GitCommandError as exc: return [ self.state.document.reporter.warning( - "Cannot find contributors for range '{}'".format(range_), + "Cannot find contributors for range '{}': {}".format( + range_, exc), line=self.lineno) ] else: diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index d1d48f9810419..e7191136a7d53 100644 --- a/pandas/core/dtypes/base.py +++ b/pandas/core/dtypes/base.py @@ -68,11 +68,6 @@ class property**. ``pandas.errors.AbstractMethodError`` and no ``register`` method is provided for registering virtual subclasses. """ - # na_value is the default NA value to use for this type. This is used in - # e.g. ExtensionArray.take. This should be the user-facing "boxed" version - # of the NA value, not the physical NA value for storage. - # e.g. for JSONArray, this is an empty dictionary. - na_value = np.nan _metadata = () # type: Tuple[str, ...] def __str__(self): @@ -114,6 +109,17 @@ def __hash__(self): def __ne__(self, other): return not self.__eq__(other) + @property + def na_value(self): + """ + Default NA value to use for this type. + + This is used in e.g. ExtensionArray.take. This should be the + user-facing "boxed" version of the NA value, not the physical NA value + for storage. e.g. for JSONArray, this is an empty dictionary. + """ + return np.nan + @property def type(self) -> Type: """ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 9f0f89a0e34f5..4601d63f2d27e 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -229,7 +229,6 @@ def _outer_indexer(self, left, right): _data = None _id = None name = None - asi8 = None _comparables = ['name'] _attributes = ['name'] _is_numeric_dtype = False @@ -501,6 +500,18 @@ def __new__(cls, data=None, dtype=None, copy=False, name=None, See each method's docstring. """ + @property + def asi8(self): + """ + Integer representation of the values. + + Returns + ------- + ndarray + An ndarray with int64 dtype. + """ + return None + @classmethod def _simple_new(cls, values, name=None, dtype=None, **kwargs): """