Skip to content

Commit

Permalink
MAINT: Clean up docs in pandas/errors/__init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored Aug 23, 2017
1 parent 0cf2b14 commit 66ec5f3
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions pandas/errors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# flake8: noqa

""" expose public exceptions & warnings """
"""
Expose public exceptions & warnings
"""

from pandas._libs.tslib import OutOfBoundsDatetime


class PerformanceWarning(Warning):
"""
Warnings shown when there is a possible performance
impact.
Warning raised when there is a possible
performance impact.
"""

class UnsupportedFunctionCall(ValueError):
"""
If attempting to call a numpy function on a pandas
object. For example using ``np.cumsum(groupby_object)``.
Exception raised when attempting to call a numpy function
on a pandas object, but that function is not supported by
the object e.g. ``np.cumsum(groupby_object)``.
"""

class UnsortedIndexError(KeyError):
"""
Error raised when attempting to get a slice of a MultiIndex
Error raised when attempting to get a slice of a MultiIndex,
and the index has not been lexsorted. Subclass of `KeyError`.
.. versionadded:: 0.20.0
Expand All @@ -29,22 +32,22 @@ class UnsortedIndexError(KeyError):

class ParserError(ValueError):
"""
Exception that is thrown by an error is encountered in `pd.read_csv`
Exception that is raised by an error encountered in `pd.read_csv`.
"""


class DtypeWarning(Warning):
"""
Warning that is raised for a dtype incompatiblity. This is
Warning that is raised for a dtype incompatiblity. This
can happen whenever `pd.read_csv` encounters non-
uniform dtypes in a column(s) of a given CSV file
uniform dtypes in a column(s) of a given CSV file.
"""


class EmptyDataError(ValueError):
"""
Exception that is thrown in `pd.read_csv` (by both the C and
Python engines) when empty data or header is encountered
Python engines) when empty data or header is encountered.
"""


Expand All @@ -53,13 +56,12 @@ class ParserWarning(Warning):
Warning that is raised in `pd.read_csv` whenever it is necessary
to change parsers (generally from 'c' to 'python') contrary to the
one specified by the user due to lack of support or functionality for
parsing particular attributes of a CSV file with the requsted engine
parsing particular attributes of a CSV file with the requsted engine.
"""


class MergeError(ValueError):
"""
Error raised when problems arise during merging due to problems
with input data. Subclass of `ValueError`.
"""

4 comments on commit 66ec5f3

@gfyoung
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreback @jorisvandenbossche : Any idea why Travis is failing suddenly on such an innocuous commit:

https://travis-ci.org/pandas-dev/pandas/jobs/267760269#L1628

@jorisvandenbossche
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but it is in any case not related, and I have seen that failure yesterday on a PR as well, thinking that it did not really seem related to that PR.

BTW: I would like to propose that we as a general rule never push to master directly. Even for such small edits, it is very easy to just make a PR (not because this is one is now failing, as it is not related, but just as a general rule)

@jorisvandenbossche
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened an issue to track it: #17323

@gfyoung
Copy link
Member Author

@gfyoung gfyoung commented on 66ec5f3 Aug 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to propose that we as a general rule never push to master directly.

That's fair. I only do it (rarely) on occasions when I'm 100% sure that my changes should not precipitate a failure (and if they do, then I'm pretty sure that there is a bug lying around somewhere, perhaps not even in pandas - I had a similar push that caught a pyarrow package issue on conda for example).

Please sign in to comment.