Skip to content

Commit

Permalink
remove unsafe assert
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Oct 18, 2024
1 parent 30622fe commit 327fa16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions dbt/adapters/databricks/python_models/python_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def __init__(self, parsed_model: Dict, credentials: DatabricksCredentials) -> No
self.parsed_model.config.timeout,
self.parsed_model.config.user_folder_for_python,
)
self.validate_config()

self.command_submitter = self.build_submitter()
self.validate_config()

@abstractmethod
def build_submitter(self) -> PythonSubmitter:
Expand Down Expand Up @@ -166,9 +166,12 @@ def __init__(
self.packages = model.config.packages
self.index_url = model.config.index_url
self.additional_libraries = model.config.additional_libs
assert model.config.python_job_config is not None
self.job_grants = model.config.python_job_config.grants
self.additional_job_settings = model.config.python_job_config.dict()
if model.config.python_job_config:
self.job_grants = model.config.python_job_config.grants
self.additional_job_settings = model.config.python_job_config.dict()
else:
self.job_grants = {}
self.additional_job_settings = {}
self.cluster_spec = cluster_spec

def update_with_acls(self, cluster_dict: Dict[str, Any]) -> Dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def pytest_addoption(parser):
parser.addoption("--profile", action="store", default="databricks_uc_cluster", type=str)
parser.addoption("--profile", action="store", default="databricks_uc_sql_endpoint", type=str)


# Using @pytest.mark.skip_profile('databricks_cluster') uses the 'skip_by_adapter_type'
Expand Down

0 comments on commit 327fa16

Please sign in to comment.