New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
deps: require pyarrow for pandas support #314
Changes from 1 commit
487c19d
08f7805
9fd5a8d
5dd13cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
fastparquet==0.4.1 | ||
google-api-core==1.22.2 | ||
google-cloud-bigquery-storage==2.0.0 | ||
google-cloud-core==1.4.1 | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -32,10 +32,6 @@ | |||||||||||||||||||||||||||||
import pytz | ||||||||||||||||||||||||||||||
import pkg_resources | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
try: | ||||||||||||||||||||||||||||||
import fastparquet | ||||||||||||||||||||||||||||||
except (ImportError, AttributeError): # pragma: NO COVER | ||||||||||||||||||||||||||||||
fastparquet = None | ||||||||||||||||||||||||||||||
try: | ||||||||||||||||||||||||||||||
import pandas | ||||||||||||||||||||||||||||||
except (ImportError, AttributeError): # pragma: NO COVER | ||||||||||||||||||||||||||||||
|
@@ -7839,7 +7835,6 @@ def test_load_table_from_dataframe_unknown_table(self): | |||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
@unittest.skipIf(pandas is None, "Requires `pandas`") | ||||||||||||||||||||||||||||||
@unittest.skipIf(fastparquet is None, "Requires `fastparquet`") | ||||||||||||||||||||||||||||||
def test_load_table_from_dataframe_no_pyarrow_warning(self): | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit surprised to see this test passing. I guess we still have some code that falls back to the default pandas parquet rendering? Can you look into if we can remove that code path? Related: We should be able to simplify this docstring now: python-bigquery/google/cloud/bigquery/client.py Lines 2134 to 2147 in cbcb4b8
|
||||||||||||||||||||||||||||||
from google.cloud.bigquery.client import PyarrowMissingWarning | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
@@ -7875,7 +7870,6 @@ def test_load_table_from_dataframe_no_pyarrow_warning(self): | |||||||||||||||||||||||||||||
assert matches, "A missing pyarrow deprecation warning was not raised." | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
@unittest.skipIf(pandas is None, "Requires `pandas`") | ||||||||||||||||||||||||||||||
@unittest.skipIf(fastparquet is None, "Requires `fastparquet`") | ||||||||||||||||||||||||||||||
def test_load_table_from_dataframe_no_schema_warning_wo_pyarrow(self): | ||||||||||||||||||||||||||||||
client = self._make_client() | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
@@ -8182,7 +8176,6 @@ def test_load_table_from_dataframe_w_partial_schema_extra_types(self): | |||||||||||||||||||||||||||||
assert "unknown_col" in message | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
@unittest.skipIf(pandas is None, "Requires `pandas`") | ||||||||||||||||||||||||||||||
@unittest.skipIf(fastparquet is None, "Requires `fastparquet`") | ||||||||||||||||||||||||||||||
def test_load_table_from_dataframe_w_partial_schema_missing_types(self): | ||||||||||||||||||||||||||||||
from google.cloud.bigquery.client import _DEFAULT_NUM_RETRIES | ||||||||||||||||||||||||||||||
from google.cloud.bigquery import job | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see us add "pyarrow" to the "pandas" extras now, since it's needed for both uploads and downloads to dataframe.
We can maybe refactor the
pyarrow >=1.0.0,<2.0dev
string into a variable since it's going to appear 3 times in setup.py now too