Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make storage and dataproc required Lib and disable unstable test #305

Merged
merged 4 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions dbt/adapters/bigquery/python_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
from dbt.adapters.bigquery import BigQueryConnectionManager, BigQueryCredentials
from google.api_core import retry
from google.api_core.client_options import ClientOptions

try:
# library only needed for python models
from google.cloud import storage, dataproc_v1 # type: ignore
except ImportError:
_has_dataproc_lib = False
else:
_has_dataproc_lib = True
from google.cloud import storage, dataproc_v1 # type: ignore


class BaseDataProcHelper(PythonJobHelper):
Expand All @@ -21,10 +14,6 @@ def __init__(self, parsed_model: Dict, credential: BigQueryCredentials) -> None:
Args:
credential (_type_): _description_
"""
if not _has_dataproc_lib:
raise RuntimeError(
"You need to install [dataproc] extras to run python model in dbt-bigquery"
)
# validate all additional stuff for python is set
schema = parsed_model["schema"]
identifier = parsed_model["alias"]
Expand Down
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ def _get_dbt_core_version():
"google-cloud-bigquery>=1.25.0,<3",
"google-api-core>=1.16.0,<3",
"googleapis-common-protos>=1.6.0,<2",
"google-cloud-storage>=2.4.0",
"google-cloud-dataproc>=4.0.3",
],
extras_require={
"dataproc": [
"google-cloud-storage[dataproc]>=2.4.0",
"google-cloud-dataproc[dataproc]>=4.0.3",
],
},
zip_safe=False,
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/adapter/test_python_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dbt.tests.util import run_dbt, write_file
import dbt.tests.adapter.python_model.test_python_model as dbt_tests


@pytest.skip("cluster unstable", allow_module_level=True)
class TestPythonIncrementalMatsDataproc(dbt_tests.BasePythonIncrementalTests):
pass

Expand Down