Skip to content

Commit 8b95f1b

Browse files
authored
Fixup (#34)
* COMPAT: remove PandasError * migrate tests to all pytest idioms
1 parent 96e9df9 commit 8b95f1b

File tree

3 files changed

+123
-140
lines changed

3 files changed

+123
-140
lines changed

docs/source/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
0.1.5 / 2017-05-04
5+
------------------
6+
7+
- All gbq errors will simply be subclasses of ``ValueError`` and no longer inherit from the deprecated ``PandasError``.
8+
49
0.1.4 / 2017-03-17
510
------------------
611

pandas_gbq/gbq.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
from distutils.version import StrictVersion
1212
from pandas import compat, DataFrame, concat
13-
from pandas.core.common import PandasError
1413
from pandas.compat import lzip, bytes_to_str
1514

1615

@@ -58,35 +57,35 @@ def _test_google_api_imports():
5857
"support: {0}".format(str(e)))
5958

6059

61-
class InvalidPrivateKeyFormat(PandasError, ValueError):
60+
class InvalidPrivateKeyFormat(ValueError):
6261
"""
6362
Raised when provided private key has invalid format.
6463
"""
6564
pass
6665

6766

68-
class AccessDenied(PandasError, ValueError):
67+
class AccessDenied(ValueError):
6968
"""
7069
Raised when invalid credentials are provided, or tokens have expired.
7170
"""
7271
pass
7372

7473

75-
class DatasetCreationError(PandasError, ValueError):
74+
class DatasetCreationError(ValueError):
7675
"""
7776
Raised when the create dataset method fails
7877
"""
7978
pass
8079

8180

82-
class GenericGBQException(PandasError, ValueError):
81+
class GenericGBQException(ValueError):
8382
"""
8483
Raised when an unrecognized Google API Error occurs.
8584
"""
8685
pass
8786

8887

89-
class InvalidColumnOrder(PandasError, ValueError):
88+
class InvalidColumnOrder(ValueError):
9089
"""
9190
Raised when the provided column order for output
9291
results DataFrame does not match the schema
@@ -95,7 +94,7 @@ class InvalidColumnOrder(PandasError, ValueError):
9594
pass
9695

9796

98-
class InvalidIndexColumn(PandasError, ValueError):
97+
class InvalidIndexColumn(ValueError):
9998
"""
10099
Raised when the provided index column for output
101100
results DataFrame does not match the schema
@@ -104,15 +103,15 @@ class InvalidIndexColumn(PandasError, ValueError):
104103
pass
105104

106105

107-
class InvalidPageToken(PandasError, ValueError):
106+
class InvalidPageToken(ValueError):
108107
"""
109108
Raised when Google BigQuery fails to return,
110109
or returns a duplicate page token.
111110
"""
112111
pass
113112

114113

115-
class InvalidSchema(PandasError, ValueError):
114+
class InvalidSchema(ValueError):
116115
"""
117116
Raised when the provided DataFrame does
118117
not match the schema of the destination
@@ -121,23 +120,23 @@ class InvalidSchema(PandasError, ValueError):
121120
pass
122121

123122

124-
class NotFoundException(PandasError, ValueError):
123+
class NotFoundException(ValueError):
125124
"""
126125
Raised when the project_id, table or dataset provided in the query could
127126
not be found.
128127
"""
129128
pass
130129

131130

132-
class StreamingInsertError(PandasError, ValueError):
131+
class StreamingInsertError(ValueError):
133132
"""
134133
Raised when BigQuery reports a streaming insert error.
135134
For more information see `Streaming Data Into BigQuery
136135
<https://cloud.google.com/bigquery/streaming-data-into-bigquery>`__
137136
"""
138137

139138

140-
class TableCreationError(PandasError, ValueError):
139+
class TableCreationError(ValueError):
141140
"""
142141
Raised when the create table method fails
143142
"""

0 commit comments

Comments
 (0)