Skip to content

Commit

Permalink
remove some tests and remove session UUID generation
Browse files Browse the repository at this point in the history
  • Loading branch information
vakarisbk committed Oct 3, 2023
1 parent 5e58cfc commit 7d8ea89
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
10 changes: 3 additions & 7 deletions dbt/adapters/spark/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

import base64
import time
import uuid

logger = AdapterLogger("Spark")

Expand Down Expand Up @@ -552,14 +551,11 @@ def open(cls, connection: Connection) -> Connection:
token = creds.token
use_ssl = creds.use_ssl
user = creds.user
session_uuid = (
uuid.uuid4()
) # Generate session UUID so that all queries would end up in the same session

# URL Format: sc://localhost:15002/;session_id=str;user_id=str;token=str;use_ssl=str
# URL Format: sc://localhost:15002/;user_id=str;token=str;use_ssl=bool
if not host.startswith("sc://"):
base_url = f"sc://{creds.host}"
base_url += f":{str(port)}/;session_id={session_uuid}"
base_url = f"sc://{host}"
base_url += f":{str(port)}"

url_extensions = []
if user:
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/adapter/persist_docs/test_persist_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_delta_comments(self, project):
assert result[2] is None


@pytest.mark.skip_profile("apache_spark", "spark_session")
@pytest.mark.skip_profile("apache_spark", "spark_session", "spark_connect")
class TestPersistDocsMissingColumn:
@pytest.fixture(scope="class")
def project_config_update(self):
Expand Down
9 changes: 6 additions & 3 deletions tests/functional/adapter/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class TestArrayConstruct(BaseArrayConstruct):
pass


@pytest.mark.skip_profile("spark_connect")
class TestBoolOr(BaseBoolOr):
pass

Expand All @@ -80,16 +81,18 @@ class TestCurrentTimestamp(BaseCurrentTimestampNaive):
pass


@pytest.mark.skip_profile("spark_connect")
class TestDateAdd(BaseDateAdd):
pass


# this generates too much SQL to run successfully in our testing environments :(
@pytest.mark.skip_profile("apache_spark", "spark_session")
@pytest.mark.skip_profile("apache_spark", "spark_session", "spark_connect")
class TestDateDiff(BaseDateDiff):
pass


@pytest.mark.skip_profile("spark_connect")
class TestDateTrunc(BaseDateTrunc):
pass

Expand Down Expand Up @@ -139,12 +142,12 @@ class TestPosition(BasePosition):
pass


@pytest.mark.skip_profile("spark_session")
@pytest.mark.skip_profile("spark_session", "spark_connect")
class TestReplace(BaseReplace):
pass


@pytest.mark.skip_profile("spark_session")
@pytest.mark.skip_profile("spark_session", "spark_connect")
class TestRight(BaseRight):
pass

Expand Down

0 comments on commit 7d8ea89

Please sign in to comment.