willbarrett commented on a change in pull request #9702:
URL:
https://github.com/apache/incubator-superset/pull/9702#discussion_r418137845
##########
File path: superset/db_engine_specs/bigquery.py
##########
@@ -174,22 +177,22 @@ def df_to_sql(cls, df: pd.DataFrame, **kwargs: Any) ->
None:
`DataFrame.to_gbq()` which requires `pandas_gbq` to be installed.
:param df: Dataframe with data to be uploaded
- :param kwargs: kwargs to be passed to to_gbq() method. Requires both
`schema
- and ``name` to be present in kwargs, which are combined and passed to
- `to_gbq()` as `destination_table`.
+ :param kwargs: kwargs to be passed to to_gbq() method. Requires that
`schema`,
+ `name` and `con` are present in kwargs. `name` and `schema` are
combined
+ and passed to `to_gbq()` as `destination_table`.
"""
try:
import pandas_gbq
from google.oauth2 import service_account
except ImportError:
raise Exception(
Review comment:
While we're here, could we raise something other than `Exception`?
##########
File path: superset/db_engine_specs/bigquery.py
##########
@@ -174,22 +177,22 @@ def df_to_sql(cls, df: pd.DataFrame, **kwargs: Any) ->
None:
`DataFrame.to_gbq()` which requires `pandas_gbq` to be installed.
:param df: Dataframe with data to be uploaded
- :param kwargs: kwargs to be passed to to_gbq() method. Requires both
`schema
- and ``name` to be present in kwargs, which are combined and passed to
- `to_gbq()` as `destination_table`.
+ :param kwargs: kwargs to be passed to to_gbq() method. Requires that
`schema`,
+ `name` and `con` are present in kwargs. `name` and `schema` are
combined
+ and passed to `to_gbq()` as `destination_table`.
"""
try:
import pandas_gbq
from google.oauth2 import service_account
except ImportError:
raise Exception(
- "Could not import the library `pandas_gbq`, which is "
+ "Could not import libraries `pandas_gbq` or `google.oauth2`,
which are "
"required to be installed in your environment in order "
"to upload data to BigQuery"
)
- if not ("name" in kwargs and "schema" in kwargs):
- raise Exception("name and schema need to be defined in kwargs")
+ if not ("name" in kwargs and "schema" in kwargs and "con" in kwargs):
+ raise Exception("name, schema and con need to be defined in
kwargs")
Review comment:
Same here - if we're already in this part of the code, let's alter this
to be a custom exception.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]