From ada60c31afff6a61ba64edcb358d3e49fc19b037 Mon Sep 17 00:00:00 2001 From: Riley Latham Date: Thu, 11 Jun 2020 18:45:11 -0400 Subject: [PATCH 1/3] Remove verbose and private_key from existing code base --- pandas/io/gbq.py | 6 ------ pandas/io/parsers.py | 11 ++--------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/pandas/io/gbq.py b/pandas/io/gbq.py index 3d0792357297f..afe1234f9fa96 100644 --- a/pandas/io/gbq.py +++ b/pandas/io/gbq.py @@ -31,8 +31,6 @@ def read_gbq( credentials=None, use_bqstorage_api: Optional[bool] = None, max_results: Optional[int] = None, - private_key=None, - verbose=None, progress_bar_type: Optional[str] = None, ) -> "DataFrame": """ @@ -208,8 +206,6 @@ def to_gbq( location: Optional[str] = None, progress_bar: bool = True, credentials=None, - verbose=None, - private_key=None, ) -> None: pandas_gbq = _try_import() pandas_gbq.to_gbq( @@ -224,6 +220,4 @@ def to_gbq( location=location, progress_bar=progress_bar, credentials=credentials, - verbose=verbose, - private_key=private_key, ) diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index c54e264faedd2..3a328ac3c9c32 100644 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -215,8 +215,6 @@ Detect missing value markers (empty strings and the value of na_values). In data without any NAs, passing na_filter=False can improve the performance of reading a large file. -verbose : bool, default False - Indicate number of NA values placed in non-numeric columns. skip_blank_lines : bool, default True If True, skip over blank lines rather than interpreting as NaN values. parse_dates : bool or list of int or names or list of lists or dict, \ @@ -498,7 +496,6 @@ def _read(filepath_or_buffer: FilePathOrBuffer, kwds): "usecols": None, # 'iterator': False, "chunksize": None, - "verbose": False, "encoding": None, "squeeze": False, "compression": None, @@ -554,7 +551,6 @@ def parser_f( na_values=None, keep_default_na=True, na_filter=True, - verbose=False, skip_blank_lines=True, # Datetime Handling parse_dates=False, @@ -658,7 +654,6 @@ def parser_f( converters=converters, dtype=dtype, usecols=usecols, - verbose=verbose, encoding=encoding, squeeze=squeeze, memory_map=memory_map, @@ -1710,7 +1705,7 @@ def _agg_index(self, index, try_parse_dates=True): return index def _convert_to_ndarrays( - self, dct, na_values, na_fvalues, verbose=False, converters=None, dtypes=None + self, dct, na_values, na_fvalues, converters=None, dtypes=None ): result = {} for c, values in dct.items(): @@ -1780,7 +1775,7 @@ def _convert_to_ndarrays( cvals = self._cast_types(cvals, cast_type, c) result[c] = cvals - if verbose and na_count: + if na_count: print(f"Filled {na_count} NA values in column {c!s}") return result @@ -2303,7 +2298,6 @@ def __init__(self, f, **kwds): if "has_index_names" in kwds: self.has_index_names = kwds["has_index_names"] - self.verbose = kwds["verbose"] self.converters = kwds["converters"] self.dtype = kwds["dtype"] @@ -2588,7 +2582,6 @@ def _clean_mapping(mapping): data, clean_na_values, clean_na_fvalues, - self.verbose, clean_conv, clean_dtypes, ) From 650cbeb6c755d3442f3bfffd1e8de159fc3ad423 Mon Sep 17 00:00:00 2001 From: Riley Latham Date: Thu, 11 Jun 2020 18:49:07 -0400 Subject: [PATCH 2/3] Revert "Remove verbose and private_key from existing code base" This reverts commit ada60c31afff6a61ba64edcb358d3e49fc19b037. --- pandas/io/gbq.py | 6 ++++++ pandas/io/parsers.py | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pandas/io/gbq.py b/pandas/io/gbq.py index afe1234f9fa96..3d0792357297f 100644 --- a/pandas/io/gbq.py +++ b/pandas/io/gbq.py @@ -31,6 +31,8 @@ def read_gbq( credentials=None, use_bqstorage_api: Optional[bool] = None, max_results: Optional[int] = None, + private_key=None, + verbose=None, progress_bar_type: Optional[str] = None, ) -> "DataFrame": """ @@ -206,6 +208,8 @@ def to_gbq( location: Optional[str] = None, progress_bar: bool = True, credentials=None, + verbose=None, + private_key=None, ) -> None: pandas_gbq = _try_import() pandas_gbq.to_gbq( @@ -220,4 +224,6 @@ def to_gbq( location=location, progress_bar=progress_bar, credentials=credentials, + verbose=verbose, + private_key=private_key, ) diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index 3a328ac3c9c32..c54e264faedd2 100644 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -215,6 +215,8 @@ Detect missing value markers (empty strings and the value of na_values). In data without any NAs, passing na_filter=False can improve the performance of reading a large file. +verbose : bool, default False + Indicate number of NA values placed in non-numeric columns. skip_blank_lines : bool, default True If True, skip over blank lines rather than interpreting as NaN values. 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): "usecols": None, # 'iterator': False, "chunksize": None, + "verbose": False, "encoding": None, "squeeze": False, "compression": None, @@ -551,6 +554,7 @@ def parser_f( na_values=None, keep_default_na=True, na_filter=True, + verbose=False, skip_blank_lines=True, # Datetime Handling parse_dates=False, @@ -654,6 +658,7 @@ def parser_f( converters=converters, dtype=dtype, usecols=usecols, + verbose=verbose, encoding=encoding, squeeze=squeeze, memory_map=memory_map, @@ -1705,7 +1710,7 @@ def _agg_index(self, index, try_parse_dates=True): return index def _convert_to_ndarrays( - self, dct, na_values, na_fvalues, converters=None, dtypes=None + self, dct, na_values, na_fvalues, verbose=False, converters=None, dtypes=None ): result = {} for c, values in dct.items(): @@ -1775,7 +1780,7 @@ def _convert_to_ndarrays( cvals = self._cast_types(cvals, cast_type, c) result[c] = cvals - if na_count: + if verbose and na_count: print(f"Filled {na_count} NA values in column {c!s}") return result @@ -2298,6 +2303,7 @@ def __init__(self, f, **kwds): if "has_index_names" in kwds: self.has_index_names = kwds["has_index_names"] + self.verbose = kwds["verbose"] self.converters = kwds["converters"] self.dtype = kwds["dtype"] @@ -2582,6 +2588,7 @@ def _clean_mapping(mapping): data, clean_na_values, clean_na_fvalues, + self.verbose, clean_conv, clean_dtypes, ) From 7746e76b49eaebd8a64041c219c48efaa20c2c7e Mon Sep 17 00:00:00 2001 From: Riley Latham Date: Thu, 11 Jun 2020 18:53:45 -0400 Subject: [PATCH 3/3] CLN: remove verbose and private_key references #34640 --- pandas/io/gbq.py | 6 ------ pandas/io/parsers.py | 11 ++--------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/pandas/io/gbq.py b/pandas/io/gbq.py index 3d0792357297f..afe1234f9fa96 100644 --- a/pandas/io/gbq.py +++ b/pandas/io/gbq.py @@ -31,8 +31,6 @@ def read_gbq( credentials=None, use_bqstorage_api: Optional[bool] = None, max_results: Optional[int] = None, - private_key=None, - verbose=None, progress_bar_type: Optional[str] = None, ) -> "DataFrame": """ @@ -208,8 +206,6 @@ def to_gbq( location: Optional[str] = None, progress_bar: bool = True, credentials=None, - verbose=None, - private_key=None, ) -> None: pandas_gbq = _try_import() pandas_gbq.to_gbq( @@ -224,6 +220,4 @@ def to_gbq( location=location, progress_bar=progress_bar, credentials=credentials, - verbose=verbose, - private_key=private_key, ) diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index c54e264faedd2..3a328ac3c9c32 100644 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -215,8 +215,6 @@ Detect missing value markers (empty strings and the value of na_values). In data without any NAs, passing na_filter=False can improve the performance of reading a large file. -verbose : bool, default False - Indicate number of NA values placed in non-numeric columns. skip_blank_lines : bool, default True If True, skip over blank lines rather than interpreting as NaN values. parse_dates : bool or list of int or names or list of lists or dict, \ @@ -498,7 +496,6 @@ def _read(filepath_or_buffer: FilePathOrBuffer, kwds): "usecols": None, # 'iterator': False, "chunksize": None, - "verbose": False, "encoding": None, "squeeze": False, "compression": None, @@ -554,7 +551,6 @@ def parser_f( na_values=None, keep_default_na=True, na_filter=True, - verbose=False, skip_blank_lines=True, # Datetime Handling parse_dates=False, @@ -658,7 +654,6 @@ def parser_f( converters=converters, dtype=dtype, usecols=usecols, - verbose=verbose, encoding=encoding, squeeze=squeeze, memory_map=memory_map, @@ -1710,7 +1705,7 @@ def _agg_index(self, index, try_parse_dates=True): return index def _convert_to_ndarrays( - self, dct, na_values, na_fvalues, verbose=False, converters=None, dtypes=None + self, dct, na_values, na_fvalues, converters=None, dtypes=None ): result = {} for c, values in dct.items(): @@ -1780,7 +1775,7 @@ def _convert_to_ndarrays( cvals = self._cast_types(cvals, cast_type, c) result[c] = cvals - if verbose and na_count: + if na_count: print(f"Filled {na_count} NA values in column {c!s}") return result @@ -2303,7 +2298,6 @@ def __init__(self, f, **kwds): if "has_index_names" in kwds: self.has_index_names = kwds["has_index_names"] - self.verbose = kwds["verbose"] self.converters = kwds["converters"] self.dtype = kwds["dtype"] @@ -2588,7 +2582,6 @@ def _clean_mapping(mapping): data, clean_na_values, clean_na_fvalues, - self.verbose, clean_conv, clean_dtypes, )