diff --git a/setup.py b/setup.py index 8592a232e..afe1cf15c 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,11 @@ all_extras = [] for extra in extras: + if extra == "fastparquet": + # Skip fastparquet from "all" because it is redundant with pyarrow and + # creates a dependency on pre-release versions of numpy. See: + # https://github.com/googleapis/google-cloud-python/issues/8549 + continue all_extras.extend(extras[extra]) extras["all"] = all_extras diff --git a/tests/unit/test__pandas_helpers.py b/tests/unit/test__pandas_helpers.py index 1c95aef0c..10189a6d3 100644 --- a/tests/unit/test__pandas_helpers.py +++ b/tests/unit/test__pandas_helpers.py @@ -533,16 +533,16 @@ def test_dataframe_to_arrow_w_unknown_type(module_under_test): @pytest.mark.skipIf(pandas is None, "Requires `pandas`") def test_dataframe_to_parquet_without_pyarrow(module_under_test, monkeypatch): monkeypatch.setattr(module_under_test, "pyarrow", None) - with pytest.raises(ValueError) as exc: + with pytest.raises(ValueError) as exc_context: module_under_test.dataframe_to_parquet(pandas.DataFrame(), (), None) - assert "pyarrow is required" in str(exc) + assert "pyarrow is required" in str(exc_context.value) @pytest.mark.skipIf(pandas is None, "Requires `pandas`") @pytest.mark.skipIf(pyarrow is None, "Requires `pyarrow`") def test_dataframe_to_parquet_w_missing_columns(module_under_test, monkeypatch): - with pytest.raises(ValueError) as exc: + with pytest.raises(ValueError) as exc_context: module_under_test.dataframe_to_parquet( pandas.DataFrame(), (schema.SchemaField("not_found", "STRING"),), None ) - assert "columns in schema must match" in str(exc) + assert "columns in schema must match" in str(exc_context.value) diff --git a/tests/unit/test_magics.py b/tests/unit/test_magics.py index f3e64a46f..ab5b14174 100644 --- a/tests/unit/test_magics.py +++ b/tests/unit/test_magics.py @@ -273,10 +273,10 @@ def test__make_bqstorage_client_true_raises_import_error(monkeypatch): google.auth.credentials.Credentials, instance=True ) - with pytest.raises(ImportError) as exc: + with pytest.raises(ImportError) as exc_context: magics._make_bqstorage_client(True, credentials_mock) - assert "google-cloud-bigquery-storage" in str(exc) + assert "google-cloud-bigquery-storage" in str(exc_context.value) @pytest.mark.usefixtures("ipython_interactive") diff --git a/tests/unit/test_table.py b/tests/unit/test_table.py index a0ded1617..72d6cf401 100644 --- a/tests/unit/test_table.py +++ b/tests/unit/test_table.py @@ -2226,9 +2226,9 @@ def test_to_dataframe_w_bqstorage_raises_import_error(self): with mock.patch.object(mut, "bigquery_storage_v1beta1", None), pytest.raises( ValueError - ) as exc: + ) as exc_context: row_iterator.to_dataframe(bqstorage_client=bqstorage_client) - assert mut._NO_BQSTORAGE_ERROR in str(exc) + assert mut._NO_BQSTORAGE_ERROR in str(exc_context.value) @unittest.skipIf( bigquery_storage_v1beta1 is None, "Requires `google-cloud-bigquery-storage`" @@ -2514,6 +2514,6 @@ def test_table_reference_to_bqstorage_raises_import_error(): for cls in classes: with mock.patch.object(mut, "bigquery_storage_v1beta1", None), pytest.raises( ValueError - ) as exc: + ) as exc_context: cls.from_string("my-project.my_dataset.my_table").to_bqstorage() - assert mut._NO_BQSTORAGE_ERROR in str(exc) + assert mut._NO_BQSTORAGE_ERROR in str(exc_context.value)