2020BIGQUERY_INSTALLED_VERSION = None
2121BIGQUERY_CLIENT_INFO_VERSION = "1.12.0"
2222HAS_CLIENT_INFO = False
23- SHOW_VERBOSE_DEPRECATION = False
24- SHOW_PRIVATE_KEY_DEPRECATION = False
25- PRIVATE_KEY_DEPRECATION_MESSAGE = (
26- "private_key is deprecated and will be removed in a future version."
27- "Use the credentials argument instead. See "
28- "https://pandas-gbq.readthedocs.io/en/latest/howto/authentication.html "
29- "for examples on using the credentials argument with service account keys."
30- )
3123
3224try :
3325 import tqdm # noqa
3628
3729
3830def _check_google_client_version ():
39- global BIGQUERY_INSTALLED_VERSION , HAS_CLIENT_INFO , SHOW_VERBOSE_DEPRECATION , SHOW_PRIVATE_KEY_DEPRECATION
31+ global BIGQUERY_INSTALLED_VERSION , HAS_CLIENT_INFO , SHOW_VERBOSE_DEPRECATION
4032
4133 try :
4234 import pkg_resources
@@ -74,10 +66,6 @@ def _check_google_client_version():
7466 SHOW_VERBOSE_DEPRECATION = (
7567 pandas_installed_version >= pandas_version_wo_verbosity
7668 )
77- pandas_version_with_credentials_arg = pkg_resources .parse_version ("0.24.0" )
78- SHOW_PRIVATE_KEY_DEPRECATION = (
79- pandas_installed_version >= pandas_version_with_credentials_arg
80- )
8169
8270
8371def _test_google_api_imports ():
@@ -951,27 +939,12 @@ def read_gbq(
951939 results.
952940
953941 .. versionadded:: 0.12.0
954- verbose : None, deprecated
955- Deprecated in Pandas-GBQ 0.4.0. Use the `logging module
956- to adjust verbosity instead
957- <https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
958- private_key : str, deprecated
959- Deprecated in pandas-gbq version 0.8.0. Use the ``credentials``
960- parameter and
961- :func:`google.oauth2.service_account.Credentials.from_service_account_info`
962- or
963- :func:`google.oauth2.service_account.Credentials.from_service_account_file`
964- instead.
965-
966- Service account private key in JSON format. Can be file path
967- or string contents. This is useful for remote server
968- authentication (eg. Jupyter/IPython notebook on remote host).
969-
970942 progress_bar_type (Optional[str]):
971- If set, use the `tqdm <https://tqdm.github.io/>`_ library to
943+ If set, use the `tqdm <https://tqdm.github.io/>`__ library to
972944 display a progress bar while the data downloads. Install the
973945 ``tqdm`` package to use this feature.
974946 Possible values of ``progress_bar_type`` include:
947+
975948 ``None``
976949 No progress bar.
977950 ``'tqdm'``
@@ -983,6 +956,17 @@ def read_gbq(
983956 ``'tqdm_gui'``
984957 Use the :func:`tqdm.tqdm_gui` function to display a
985958 progress bar as a graphical dialog box.
959+ verbose : None, deprecated
960+ Deprecated in Pandas-GBQ 0.4.0. Use the `logging module
961+ to adjust verbosity instead
962+ <https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
963+ private_key : str, deprecated
964+ Deprecated in pandas-gbq version 0.8.0. Use the ``credentials``
965+ parameter and
966+ :func:`google.oauth2.service_account.Credentials.from_service_account_info`
967+ or
968+ :func:`google.oauth2.service_account.Credentials.from_service_account_file`
969+ instead.
986970
987971 Returns
988972 -------
@@ -1008,11 +992,6 @@ def read_gbq(
1008992 stacklevel = 2 ,
1009993 )
1010994
1011- if private_key is not None and SHOW_PRIVATE_KEY_DEPRECATION :
1012- warnings .warn (
1013- PRIVATE_KEY_DEPRECATION_MESSAGE , FutureWarning , stacklevel = 2
1014- )
1015-
1016995 if dialect not in ("legacy" , "standard" ):
1017996 raise ValueError ("'{0}' is not valid for dialect" .format (dialect ))
1018997
@@ -1172,10 +1151,6 @@ def to_gbq(
11721151 or
11731152 :func:`google.oauth2.service_account.Credentials.from_service_account_file`
11741153 instead.
1175-
1176- Service account private key in JSON format. Can be file path
1177- or string contents. This is useful for remote server
1178- authentication (eg. Jupyter/IPython notebook on remote host).
11791154 """
11801155
11811156 _test_google_api_imports ()
@@ -1190,11 +1165,6 @@ def to_gbq(
11901165 stacklevel = 1 ,
11911166 )
11921167
1193- if private_key is not None and SHOW_PRIVATE_KEY_DEPRECATION :
1194- warnings .warn (
1195- PRIVATE_KEY_DEPRECATION_MESSAGE , FutureWarning , stacklevel = 2
1196- )
1197-
11981168 if if_exists not in ("fail" , "replace" , "append" ):
11991169 raise ValueError ("'{0}' is not valid for if_exists" .format (if_exists ))
12001170
0 commit comments