|
12 | 12 | from pandas.core.common import AbstractMethodError |
13 | 13 | from pandas.types.common import is_number |
14 | 14 |
|
| 15 | +# compat |
| 16 | +from pandas.errors import (ParserError, DtypeWarning, # noqa |
| 17 | + EmptyDataError, ParserWarning) |
| 18 | + |
| 19 | +# gh-12665: Alias for now and remove later. |
| 20 | +CParserError = ParserError |
| 21 | + |
| 22 | + |
15 | 23 | try: |
16 | 24 | from s3fs import S3File |
17 | 25 | need_text_wrapping = (BytesIO, S3File) |
@@ -69,43 +77,6 @@ def urlopen(*args, **kwargs): |
69 | 77 | _VALID_URLS.discard('') |
70 | 78 |
|
71 | 79 |
|
72 | | -class ParserError(ValueError): |
73 | | - """ |
74 | | - Exception that is thrown by an error is encountered in `pd.read_csv` |
75 | | - """ |
76 | | - pass |
77 | | - |
78 | | - |
79 | | -# gh-12665: Alias for now and remove later. |
80 | | -CParserError = ParserError |
81 | | - |
82 | | - |
83 | | -class DtypeWarning(Warning): |
84 | | - """ |
85 | | - Warning that is raised whenever `pd.read_csv` encounters non- |
86 | | - uniform dtypes in a column(s) of a given CSV file |
87 | | - """ |
88 | | - pass |
89 | | - |
90 | | - |
91 | | -class EmptyDataError(ValueError): |
92 | | - """ |
93 | | - Exception that is thrown in `pd.read_csv` (by both the C and |
94 | | - Python engines) when empty data or header is encountered |
95 | | - """ |
96 | | - pass |
97 | | - |
98 | | - |
99 | | -class ParserWarning(Warning): |
100 | | - """ |
101 | | - Warning that is raised in `pd.read_csv` whenever it is necessary |
102 | | - to change parsers (generally from 'c' to 'python') contrary to the |
103 | | - one specified by the user due to lack of support or functionality for |
104 | | - parsing particular attributes of a CSV file with the requsted engine |
105 | | - """ |
106 | | - pass |
107 | | - |
108 | | - |
109 | 80 | class BaseIterator(object): |
110 | 81 | """Subclass this and provide a "__next__()" method to obtain an iterator. |
111 | 82 | Useful only when the object being iterated is non-reusable (e.g. OK for a |
|
0 commit comments