@@ -487,6 +487,19 @@ def to_gbq(
487
487
str:
488
488
The fully-qualified ID for the written table, in the form
489
489
``project.dataset.tablename``.
490
+
491
+ Raises:
492
+ ValueError:
493
+ If an invalid value is provided for ``if_exists`` when ``destination_table``
494
+ is ``None``. ``None`` or ``replace`` are the only valid values for ``if_exists``.
495
+ ValueError:
496
+ If an invalid value is provided for ``destination_table`` that is
497
+ not one of ``datasetID.tableId`` or ``projectId.datasetId.tableId``.
498
+ ValueError:
499
+ If an invalid value is provided for ``if_exists`` that is not one of
500
+ ``fail``, ``replace``, or ``append``.
501
+
502
+
490
503
"""
491
504
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
492
505
@@ -531,7 +544,13 @@ def to_parquet(
531
544
If ``False``, they will not be written to the file.
532
545
533
546
Returns:
534
- None or bytes: bytes if no path argument is provided else None
547
+ None or bytes:
548
+ bytes if no path argument is provided else None
549
+
550
+ Raises:
551
+ ValueError:
552
+ If an invalid value provided for `compression` that is not one of
553
+ ``None``, ``snappy``, or ``gzip``.
535
554
"""
536
555
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
537
556
@@ -1140,9 +1159,11 @@ def insert(self, loc, column, value, allow_duplicates=False):
1140
1159
Allow duplicate column labels to be created.
1141
1160
1142
1161
Raises:
1162
+ IndexError:
1163
+ If ``column`` index is out of bounds with the total count of columns.
1143
1164
ValueError:
1144
- If `column` is already contained in the DataFrame,
1145
- unless `allow_duplicates` is set to True.
1165
+ If `` column` ` is already contained in the DataFrame,
1166
+ unless `` allow_duplicates` ` is set to True.
1146
1167
"""
1147
1168
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
1148
1169
@@ -1259,10 +1280,14 @@ def drop(
1259
1280
level:
1260
1281
For MultiIndex, level from which the labels will be removed.
1261
1282
Returns:
1262
- bigframes.pandas.DataFrame: DataFrame without the removed column labels.
1283
+ bigframes.pandas.DataFrame:
1284
+ DataFrame without the removed column labels.
1263
1285
1264
1286
Raises:
1265
1287
KeyError: If any of the labels is not found in the selected axis.
1288
+ ValueError: If values for both ``labels`` and ``index``/``columns`` are provided.
1289
+ ValueError: If a multi-index tuple is provided as ``level``.
1290
+ ValueError: If either ``labels`` or ``index``/``columns`` is not provided.
1266
1291
"""
1267
1292
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
1268
1293
@@ -1419,7 +1444,12 @@ def set_index(
1419
1444
Delete columns to be used as the new index.
1420
1445
1421
1446
Returns:
1422
- bigframes.pandas.DataFrame: Changed row labels.
1447
+ bigframes.pandas.DataFrame:
1448
+ Changed row labels.
1449
+
1450
+ Raises:
1451
+ KeyError:
1452
+ If key(s) are not in the columns.
1423
1453
"""
1424
1454
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
1425
1455
@@ -1437,7 +1467,12 @@ def reorder_levels(
1437
1467
Where to reorder levels.
1438
1468
1439
1469
Returns:
1440
- bigframes.pandas.DataFrame: DataFrame of rearranged index.
1470
+ bigframes.pandas.DataFrame:
1471
+ DataFrame of rearranged index.
1472
+
1473
+ Raises:
1474
+ ValueError:
1475
+ If columns are not multi-index.
1441
1476
"""
1442
1477
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
1443
1478
@@ -1455,7 +1490,12 @@ def swaplevel(self, i, j, axis: str | int = 0) -> DataFrame:
1455
1490
'columns' for column-wise.
1456
1491
1457
1492
Returns:
1458
- bigframes.pandas.DataFrame: DataFrame with levels swapped in MultiIndex.
1493
+ bigframes.pandas.DataFrame:
1494
+ DataFrame with levels swapped in MultiIndex.
1495
+
1496
+ Raises:
1497
+ ValueError:
1498
+ If columns are not multi-index.
1459
1499
"""
1460
1500
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
1461
1501
@@ -1474,7 +1514,12 @@ def droplevel(self, level, axis: str | int = 0):
1474
1514
* 0 or 'index': remove level(s) in column.
1475
1515
* 1 or 'columns': remove level(s) in row.
1476
1516
Returns:
1477
- bigframes.pandas.DataFrame: DataFrame with requested index / column level(s) removed.
1517
+ bigframes.pandas.DataFrame:
1518
+ DataFrame with requested index / column level(s) removed.
1519
+
1520
+ Raises:
1521
+ ValueError:
1522
+ If columns are not multi-index
1478
1523
"""
1479
1524
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
1480
1525
@@ -1724,7 +1769,12 @@ def dropna(
1724
1769
1725
1770
1726
1771
Returns:
1727
- bigframes.pandas.DataFrame: DataFrame with NA entries dropped from it.
1772
+ bigframes.pandas.DataFrame:
1773
+ DataFrame with NA entries dropped from it.
1774
+
1775
+ Raises:
1776
+ ValueError:
1777
+ If ``how`` is not one of ``any`` or ``all``.
1728
1778
"""
1729
1779
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
1730
1780
@@ -1772,8 +1822,13 @@ def isin(self, values):
1772
1822
the column names, which must match.
1773
1823
1774
1824
Returns:
1775
- bigframes.pandas.DataFrame: DataFrame of booleans showing whether each element
1776
- in the DataFrame is contained in values.
1825
+ bigframes.pandas.DataFrame:
1826
+ DataFrame of booleans showing whether each element
1827
+ in the DataFrame is contained in values.
1828
+
1829
+ Raises:
1830
+ TypeError:
1831
+ If values provided are not list-like objects.
1777
1832
"""
1778
1833
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
1779
1834
@@ -2004,7 +2059,12 @@ def sort_values(
2004
2059
if `first`; `last` puts NaNs at the end.
2005
2060
2006
2061
Returns:
2007
- bigframes.pandas.DataFrame: DataFrame with sorted values.
2062
+ bigframes.pandas.DataFrame:
2063
+ DataFrame with sorted values.
2064
+
2065
+ Raises:
2066
+ ValueError:
2067
+ If value of ``na_position`` is not one of ``first`` or ``last``.
2008
2068
"""
2009
2069
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
2010
2070
@@ -2014,7 +2074,14 @@ def sort_index(
2014
2074
"""Sort object by labels (along an axis).
2015
2075
2016
2076
Returns:
2017
- bigframes.pandas.DataFrame: The original DataFrame sorted by the labels.
2077
+ bigframes.pandas.DataFrame:
2078
+ The original DataFrame sorted by the labels.
2079
+
2080
+ Raises:
2081
+ ValueError:
2082
+ If value of ``na_position`` is not one of ``first`` or ``last``.
2083
+ ValueError:
2084
+ If length of ``ascending`` dose not equal length of ``by``.
2018
2085
"""
2019
2086
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
2020
2087
@@ -3727,7 +3794,12 @@ def combine(
3727
3794
overwritten with NaNs.
3728
3795
3729
3796
Returns:
3730
- bigframes.pandas.DataFrame: Combination of the provided DataFrames.
3797
+ bigframes.pandas.DataFrame:
3798
+ Combination of the provided DataFrames.
3799
+
3800
+ Raises:
3801
+ ValueError:
3802
+ If ``func`` return value is not Series.
3731
3803
"""
3732
3804
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
3733
3805
@@ -3813,8 +3885,17 @@ def explode(
3813
3885
If True, the resulting index will be labeled 0, 1, …, n - 1.
3814
3886
3815
3887
Returns:
3816
- bigframes.pandas.DataFrame: Exploded lists to rows of the subset columns;
3888
+ bigframes.pandas.DataFrame:
3889
+ Exploded lists to rows of the subset columns;
3817
3890
index will be duplicated for these rows.
3891
+
3892
+ Raises:
3893
+ ValueError:
3894
+ * If columns of the frame are not unique.
3895
+ * If specified columns to explode is empty list.
3896
+ * If specified columns to explode have not matching count of elements rowwise in the frame.
3897
+ KeyError:
3898
+ If incorrect column names are provided
3818
3899
"""
3819
3900
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
3820
3901
@@ -3929,6 +4010,10 @@ def update(
3929
4010
3930
4011
Returns:
3931
4012
None: This method directly changes calling object.
4013
+
4014
+ Raises:
4015
+ ValueError:
4016
+ If a type of join other than ``left`` is provided as an argument.
3932
4017
"""
3933
4018
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
3934
4019
@@ -4023,7 +4108,14 @@ def groupby(
4023
4108
values will also be treated as the key in groups.
4024
4109
4025
4110
Returns:
4026
- bigframes.core.groupby.SeriesGroupBy: A groupby object that contains information about the groups.
4111
+ bigframes.core.groupby.SeriesGroupBy:
4112
+ A groupby object that contains information about the groups.
4113
+
4114
+ Raises:
4115
+ ValueError:
4116
+ If both ``by`` and ``level`` are specified.
4117
+ TypeError:
4118
+ If one of ``by`` or `level`` is not specified.
4027
4119
"""
4028
4120
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
4029
4121
@@ -4109,7 +4201,14 @@ def map(self, func, na_action: Optional[str] = None) -> DataFrame:
4109
4201
values, without passing them to func.
4110
4202
4111
4203
Returns:
4112
- bigframes.pandas.DataFrame: Transformed DataFrame.
4204
+ bigframes.pandas.DataFrame:
4205
+ Transformed DataFrame.
4206
+
4207
+ Raises:
4208
+ TypeError:
4209
+ If value provided for ``func`` is not callable.
4210
+ ValueError:
4211
+ If value provided for ``na_action`` is not ``None`` or ``ignore``.
4113
4212
"""
4114
4213
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
4115
4214
@@ -4209,7 +4308,18 @@ def join(self, other, *, on: Optional[str] = None, how: str) -> DataFrame:
4209
4308
the order of the left keys.
4210
4309
4211
4310
Returns:
4212
- bigframes.pandas.DataFrame: A dataframe containing columns from both the caller and `other`.
4311
+ bigframes.pandas.DataFrame:
4312
+ A dataframe containing columns from both the caller and `other`.
4313
+
4314
+ Raises:
4315
+ ValueError:
4316
+ If value for ``on`` is specified for cross join.
4317
+ ValueError:
4318
+ If join on columns does not match the index level of the other
4319
+ DataFrame. Join on columns with multi-index is not supported.
4320
+ ValueError:
4321
+ If left index to join on does not have the same number of levels
4322
+ as the right index.
4213
4323
"""
4214
4324
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
4215
4325
@@ -4354,7 +4464,20 @@ def merge(
4354
4464
no suffix. At least one of the values must not be None.
4355
4465
4356
4466
Returns:
4357
- bigframes.pandas.DataFrame: A DataFrame of the two merged objects.
4467
+ bigframes.pandas.DataFrame:
4468
+ A DataFrame of the two merged objects.
4469
+
4470
+ Raises:
4471
+ ValueError:
4472
+ If value for ``on`` is specified for cross join.
4473
+ ValueError:
4474
+ If ``on`` or ``left_on`` + ``right_on`` are not specified when ``on`` is ``None``.
4475
+ ValueError:
4476
+ If ``on`` and ``left_on`` + ``right_on`` are specified when ``on`` is not ``None``.
4477
+ ValueError:
4478
+ If no column with the provided label is found in ``self`` for left join.
4479
+ ValueError:
4480
+ If no column with the provided label is found in ``self`` for right join.
4358
4481
"""
4359
4482
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
4360
4483
@@ -4469,6 +4592,16 @@ def apply(self, func, *, axis=0, args=(), **kwargs):
4469
4592
Returns:
4470
4593
bigframes.pandas.DataFrame or bigframes.pandas.Series:
4471
4594
Result of applying ``func`` along the given axis of the DataFrame.
4595
+
4596
+ Raises:
4597
+ ValueError:
4598
+ If a remote function is not provided when ``axis=1`` is specified.
4599
+ ValueError:
4600
+ If number or input params in the remote function are not the same as
4601
+ the number of columns in the dataframe.
4602
+ ValueError:
4603
+ If the dtypes of the columns in the dataframe are not compatible with
4604
+ the data types of the remote function input params.
4472
4605
"""
4473
4606
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
4474
4607
@@ -5156,7 +5289,12 @@ def nlargest(self, n: int, columns, keep: str = "first"):
5156
5289
selecting more than `n` items.
5157
5290
5158
5291
Returns:
5159
- bigframes.pandas.DataFrame: The first `n` rows ordered by the given columns in descending order.
5292
+ bigframes.pandas.DataFrame:
5293
+ The first `n` rows ordered by the given columns in descending order.
5294
+
5295
+ Raises:
5296
+ ValueError:
5297
+ If value of ``keep`` is not ``first``, ``last``, or ``all``.
5160
5298
"""
5161
5299
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
5162
5300
@@ -5244,7 +5382,12 @@ def nsmallest(self, n: int, columns, keep: str = "first"):
5244
5382
selecting more than `n` items.
5245
5383
5246
5384
Returns:
5247
- bigframes.pandas.DataFrame: The first `n` rows ordered by the given columns in ascending order.
5385
+ bigframes.pandas.DataFrame:
5386
+ The first `n` rows ordered by the given columns in ascending order.
5387
+
5388
+ Raises:
5389
+ ValueError:
5390
+ If value of ``keep`` is not ``first``, ``last``, or ``all``.
5248
5391
"""
5249
5392
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
5250
5393
@@ -5513,7 +5656,12 @@ def cumsum(self) -> DataFrame:
5513
5656
[3 rows x 2 columns]
5514
5657
5515
5658
Returns:
5516
- bigframes.pandas.DataFrame: Return cumulative sum of DataFrame.
5659
+ bigframes.pandas.DataFrame:
5660
+ Return cumulative sum of DataFrame.
5661
+
5662
+ Raises:
5663
+ ValueError:
5664
+ If values are not of numeric type.
5517
5665
"""
5518
5666
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
5519
5667
@@ -5545,7 +5693,12 @@ def cumprod(self) -> DataFrame:
5545
5693
[3 rows x 2 columns]
5546
5694
5547
5695
Returns:
5548
- bigframes.pandas.DataFrame: Return cumulative product of DataFrame.
5696
+ bigframes.pandas.DataFrame:
5697
+ Return cumulative product of DataFrame.
5698
+
5699
+ Raises:
5700
+ ValueError:
5701
+ If values are not of numeric type.
5549
5702
"""
5550
5703
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
5551
5704
@@ -5695,7 +5848,12 @@ def describe(self):
5695
5848
[8 rows x 2 columns]
5696
5849
5697
5850
Returns:
5698
- bigframes.pandas.DataFrame: Summary statistics of the Series or Dataframe provided.
5851
+ bigframes.pandas.DataFrame:
5852
+ Summary statistics of the Series or Dataframe provided.
5853
+
5854
+ Raises:
5855
+ ValueError:
5856
+ If unsupported ``include`` type is provided.
5699
5857
"""
5700
5858
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
5701
5859
@@ -6679,6 +6837,10 @@ def dot(self, other):
6679
6837
If `other` is a Series, return the matrix product between self and
6680
6838
other as a Series. If other is a DataFrame, return
6681
6839
the matrix product of self and other in a DataFrame.
6840
+
6841
+ Raises:
6842
+ RuntimeError:
6843
+ If unable to construct all columns.
6682
6844
"""
6683
6845
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
6684
6846
0 commit comments