Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/backend/src/common/unity_catalog_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def is_valid_uuid(identifier: str) -> bool:
return False


def sanitize_uc_identifier(identifier: str, max_length: int = 255) -> str:
def sanitize_uc_identifier(identifier: Optional[str], max_length: int = 255) -> str:
"""Sanitize and validate a Unity Catalog identifier.

Unity Catalog identifiers (catalog, schema, table, column names) must:
Expand Down Expand Up @@ -184,7 +184,7 @@ def sanitize_postgres_identifier(identifier: str, max_length: int = 63) -> str:
return identifier


def map_logical_type_to_column_type(logical_type: str) -> ColumnTypeName:
def map_logical_type_to_column_type(logical_type: Optional[str]) -> ColumnTypeName:
"""Map a logical type string to Databricks ColumnTypeName enum.

Args:
Expand Down
5 changes: 3 additions & 2 deletions src/backend/src/controller/semantic_links_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import List, Optional, TYPE_CHECKING
from typing import List, Optional, Union, TYPE_CHECKING
from uuid import UUID
from sqlalchemy.orm import Session
from sqlalchemy import text
import re
Expand Down Expand Up @@ -239,7 +240,7 @@ def add(self, payload: EntitySemanticLinkCreate, created_by: str | None) -> Enti
logger.warning(f"Failed to log change for semantic link add: {log_err}")
return self._to_api(db_obj)

def remove(self, link_id: str, removed_by: Optional[str] = None) -> bool:
def remove(self, link_id: Union[str, UUID], removed_by: Optional[str] = None) -> bool:
removed = entity_semantic_links_repo.remove(self._db, id=link_id)
try:
manager = None
Expand Down
2 changes: 1 addition & 1 deletion src/backend/src/controller/semantic_models_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2843,7 +2843,7 @@ def delete_collection(self, collection_iri: str, deleted_by: Optional[str] = Non
try:
coll_context = self._graph.get_context(URIRef(collection_iri))
self._graph.remove_context(coll_context)
except:
except Exception:
pass

self._db.commit()
Expand Down
1 change: 0 additions & 1 deletion src/backend/src/tests/unit/test_audit_log_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def test_create_audit_log(self, repository, db_session):
db_session.refresh(log_db)

# Assert
assert log_db is not None
assert log_db.username == "test-user"

def test_get_audit_log_by_id(self, repository, db_session):
Expand Down
1 change: 0 additions & 1 deletion src/backend/src/tests/unit/test_change_log_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_create_change_log(self, repository, db_session):
db_session.refresh(log_db)

# Assert
assert log_db is not None
assert log_db.entity_type == "data_product"

def test_get_change_log_by_id(self, repository, db_session):
Expand Down
6 changes: 3 additions & 3 deletions src/backend/src/tests/unit/test_data_products_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ def test_manager_without_workspace_client(self, db_session):
manager = DataProductsManager(db=db_session, ws_client=None)

# Assert
# Should initialize but log warning
assert manager is not None
# Should initialize but log warning; ws_client stored as None
assert manager._ws_client is None
# SDK operations should handle missing client gracefully

def test_manager_without_notifications(self, db_session):
Expand All @@ -616,5 +616,5 @@ def test_manager_without_notifications(self, db_session):
)

# Assert
assert manager is not None
assert manager._notifications_manager is None
# Should work but notifications won't be sent
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def test_create_profiling_run(self, repository, db_session, sample_contract_id):
db_session.refresh(run_db)

# Assert
assert run_db is not None
assert run_db.contract_id == sample_contract_id

def test_get_profiling_run_by_id(self, repository, db_session, sample_contract_id):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_create_notification(self, repository, db_session):
db_session.refresh(notification_db)

# Assert
assert notification_db is not None
assert notification_db.title == "Test Notification"

def test_get_notification_by_id(self, repository, db_session):
Expand Down
1 change: 0 additions & 1 deletion src/backend/src/tests/unit/test_projects_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def test_create_project(self, repository, db_session):
db_session.refresh(project_db)

# Assert
assert project_db is not None
assert project_db.name == "Test Project"

# =====================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def test_create_semantic_model(self, repository, db_session):
db_session.refresh(model_db)

# Assert
assert model_db is not None
assert model_db.name == "Test Model"

def test_get_semantic_model_by_id(self, repository, db_session):
Expand Down
1 change: 0 additions & 1 deletion src/backend/src/tests/unit/test_teams_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def test_create_team(self, repository, db_session):
db_session.refresh(team_db)

# Assert
assert team_db is not None
assert team_db.name == "Test Team"

# =====================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_create_installation(self, repository, db_session):
db_session.refresh(installation_db)

# Assert
assert installation_db is not None
assert installation_db.workflow_id == "test-workflow"

def test_get_installation_by_id(self, repository, db_session):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def test_create_job_run(self, repository, db_session, sample_installation):
db_session.refresh(job_run_db)

# Assert
assert job_run_db is not None
assert job_run_db.run_id == 98765

def test_get_job_run_by_id(self, repository, db_session, sample_installation):
Expand Down
3 changes: 0 additions & 3 deletions src/backend/src/utils/contract_cloner.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class ContractCloner:
- Sets version metadata (version_family_id, parent_contract_id, change_summary)
"""

def __init__(self):
pass

def clone_for_new_version(
self,
source_contract_db,
Expand Down
Loading