|
45 | 45 | geopandas = None
|
46 | 46 |
|
47 | 47 | try:
|
48 |
| - from tqdm import tqdm |
| 48 | + import tqdm |
| 49 | + from tqdm.std import TqdmDeprecationWarning |
| 50 | + |
49 | 51 | except (ImportError, AttributeError): # pragma: NO COVER
|
50 | 52 | tqdm = None
|
51 | 53 |
|
@@ -2798,7 +2800,7 @@ def test_to_arrow_w_bqstorage_no_streams(self):
|
2798 | 2800 |
|
2799 | 2801 | @unittest.skipIf(tqdm is None, "Requires `tqdm`")
|
2800 | 2802 | @mock.patch("tqdm.tqdm_gui")
|
2801 |
| - @mock.patch("tqdm.tqdm_notebook") |
| 2803 | + @mock.patch("tqdm.notebook.tqdm") |
2802 | 2804 | @mock.patch("tqdm.tqdm")
|
2803 | 2805 | def test_to_arrow_progress_bar(self, tqdm_mock, tqdm_notebook_mock, tqdm_gui_mock):
|
2804 | 2806 | from google.cloud.bigquery.schema import SchemaField
|
@@ -3146,7 +3148,7 @@ def test_to_dataframe_datetime_out_of_pyarrow_bounds(self):
|
3146 | 3148 | @unittest.skipIf(pandas is None, "Requires `pandas`")
|
3147 | 3149 | @unittest.skipIf(tqdm is None, "Requires `tqdm`")
|
3148 | 3150 | @mock.patch("tqdm.tqdm_gui")
|
3149 |
| - @mock.patch("tqdm.tqdm_notebook") |
| 3151 | + @mock.patch("tqdm.notebook.tqdm") |
3150 | 3152 | @mock.patch("tqdm.tqdm")
|
3151 | 3153 | def test_to_dataframe_progress_bar(
|
3152 | 3154 | self, tqdm_mock, tqdm_notebook_mock, tqdm_gui_mock
|
@@ -3249,7 +3251,7 @@ def test_to_dataframe_no_tqdm(self):
|
3249 | 3251 | @unittest.skipIf(pandas is None, "Requires `pandas`")
|
3250 | 3252 | @unittest.skipIf(tqdm is None, "Requires `tqdm`")
|
3251 | 3253 | @mock.patch("tqdm.tqdm_gui", new=None) # will raise TypeError on call
|
3252 |
| - @mock.patch("tqdm.tqdm_notebook", new=None) # will raise TypeError on call |
| 3254 | + @mock.patch("tqdm.notebook.tqdm", new=None) # will raise TypeError on call |
3253 | 3255 | @mock.patch("tqdm.tqdm", new=None) # will raise TypeError on call
|
3254 | 3256 | def test_to_dataframe_tqdm_error(self):
|
3255 | 3257 | from google.cloud.bigquery.schema import SchemaField
|
@@ -3281,7 +3283,10 @@ def test_to_dataframe_tqdm_error(self):
|
3281 | 3283 | # Warn that a progress bar was requested, but creating the tqdm
|
3282 | 3284 | # progress bar failed.
|
3283 | 3285 | for warning in warned:
|
3284 |
| - self.assertIs(warning.category, UserWarning) |
| 3286 | + self.assertIn( |
| 3287 | + warning.category, |
| 3288 | + [UserWarning, DeprecationWarning, TqdmDeprecationWarning], |
| 3289 | + ) |
3285 | 3290 |
|
3286 | 3291 | @unittest.skipIf(pandas is None, "Requires `pandas`")
|
3287 | 3292 | def test_to_dataframe_w_empty_results(self):
|
|
0 commit comments