Skip to content

Commit

Permalink
maybe this is runnable?
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-winkler committed Oct 21, 2024
1 parent 7688a82 commit 24472a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 58 deletions.
30 changes: 0 additions & 30 deletions tests/functional/python_model_tests/fixtures.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
import os
from unittest.mock import patch
import pytest

from dbt.tests.util import run_dbt, check_relations_equal_with_relations
from dbt.tests.util import run_dbt
from tests.unit.test_bigquery_adapter import BaseTestBigQueryAdapter

from tests.functional.python_model_tests.files import SINGLE_RECORD # noqa: F401

ALT_DATABASE = os.getenv("BIGQUERY_TEST_ALT_DATABASE")

"""
dataset: dbt_mwinkler_core_dev
keyfile: /Users/matt-winkler/Downloads/sales-demo-project-314714-2e886a5c2612.json
method: service-account
project: sales-demo-project-314714
threads: 4
type: bigquery
gcs_bucket: matt-w-python-demo
dataproc_cluster_name: matt-w-python-demo
dataproc_region: us-west1
dataproc_project: test-some-other-project
"""
from unittest.mock import patch


# Test application of dataproc_batch configuration to a
# google.cloud.dataproc_v1.Batch object.
# This reuses the machinery from BaseTestBigQueryAdapter to get hold of the
# parsed credentials
class TestOverrideDataprocProject(BaseTestBigQueryAdapter):
@patch(
"dbt.adapters.bigquery.connections.get_bigquery_defaults",
return_value=("credentials", "project_id"),
)
@pytest.fixture(scope="class")
def model_path(self):
return "models"

def test_update_dataproc_cluster(self):
# update the raw profile to set dataproc_project config
self.raw_profile["outputs"]["dataproc-serverless-configured"]["dataproc_batch"][
"dataproc_project"
] = "test"
adapter = self.get_adapter("dataproc-serverless-configured")
raw_profile = self.raw_profile["outputs"]["dataproc-serverless-configured"][
"dataproc_batch"
]
print("showing raw_profile")
print(raw_profile)
run_dbt(["models"])

# raw_profile = self.raw_profile["outputs"]["dataproc-serverless-configured"][
# "dataproc_batch"
# ]


# class BaseOverrideDatabase:
Expand Down

0 comments on commit 24472a6

Please sign in to comment.