Skip to content

Commit 650cbeb

Browse files
committed
Revert "Remove verbose and private_key from existing code base"
This reverts commit ada60c3.
1 parent ada60c3 commit 650cbeb

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

pandas/io/gbq.py

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def read_gbq(
3131
credentials=None,
3232
use_bqstorage_api: Optional[bool] = None,
3333
max_results: Optional[int] = None,
34+
private_key=None,
35+
verbose=None,
3436
progress_bar_type: Optional[str] = None,
3537
) -> "DataFrame":
3638
"""
@@ -206,6 +208,8 @@ def to_gbq(
206208
location: Optional[str] = None,
207209
progress_bar: bool = True,
208210
credentials=None,
211+
verbose=None,
212+
private_key=None,
209213
) -> None:
210214
pandas_gbq = _try_import()
211215
pandas_gbq.to_gbq(
@@ -220,4 +224,6 @@ def to_gbq(
220224
location=location,
221225
progress_bar=progress_bar,
222226
credentials=credentials,
227+
verbose=verbose,
228+
private_key=private_key,
223229
)

pandas/io/parsers.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@
215215
Detect missing value markers (empty strings and the value of na_values). In
216216
data without any NAs, passing na_filter=False can improve the performance
217217
of reading a large file.
218+
verbose : bool, default False
219+
Indicate number of NA values placed in non-numeric columns.
218220
skip_blank_lines : bool, default True
219221
If True, skip over blank lines rather than interpreting as NaN values.
220222
parse_dates : bool or list of int or names or list of lists or dict, \
@@ -496,6 +498,7 @@ def _read(filepath_or_buffer: FilePathOrBuffer, kwds):
496498
"usecols": None,
497499
# 'iterator': False,
498500
"chunksize": None,
501+
"verbose": False,
499502
"encoding": None,
500503
"squeeze": False,
501504
"compression": None,
@@ -551,6 +554,7 @@ def parser_f(
551554
na_values=None,
552555
keep_default_na=True,
553556
na_filter=True,
557+
verbose=False,
554558
skip_blank_lines=True,
555559
# Datetime Handling
556560
parse_dates=False,
@@ -654,6 +658,7 @@ def parser_f(
654658
converters=converters,
655659
dtype=dtype,
656660
usecols=usecols,
661+
verbose=verbose,
657662
encoding=encoding,
658663
squeeze=squeeze,
659664
memory_map=memory_map,
@@ -1705,7 +1710,7 @@ def _agg_index(self, index, try_parse_dates=True):
17051710
return index
17061711

17071712
def _convert_to_ndarrays(
1708-
self, dct, na_values, na_fvalues, converters=None, dtypes=None
1713+
self, dct, na_values, na_fvalues, verbose=False, converters=None, dtypes=None
17091714
):
17101715
result = {}
17111716
for c, values in dct.items():
@@ -1775,7 +1780,7 @@ def _convert_to_ndarrays(
17751780
cvals = self._cast_types(cvals, cast_type, c)
17761781

17771782
result[c] = cvals
1778-
if na_count:
1783+
if verbose and na_count:
17791784
print(f"Filled {na_count} NA values in column {c!s}")
17801785
return result
17811786

@@ -2298,6 +2303,7 @@ def __init__(self, f, **kwds):
22982303
if "has_index_names" in kwds:
22992304
self.has_index_names = kwds["has_index_names"]
23002305

2306+
self.verbose = kwds["verbose"]
23012307
self.converters = kwds["converters"]
23022308

23032309
self.dtype = kwds["dtype"]
@@ -2582,6 +2588,7 @@ def _clean_mapping(mapping):
25822588
data,
25832589
clean_na_values,
25842590
clean_na_fvalues,
2591+
self.verbose,
25852592
clean_conv,
25862593
clean_dtypes,
25872594
)

0 commit comments

Comments
 (0)