diff --git a/objectModel/Python/cdm/objectmodel/cdm_object_def.py b/objectModel/Python/cdm/objectmodel/cdm_object_def.py index fdb9e9535e..8b8e96e9e4 100644 --- a/objectModel/Python/cdm/objectmodel/cdm_object_def.py +++ b/objectModel/Python/cdm/objectmodel/cdm_object_def.py @@ -4,16 +4,16 @@ from abc import abstractmethod from typing import Optional, TYPE_CHECKING -from cdm.enums import CdmObjectType +from cdm.utilities import ResolveOptions from .cdm_object import CdmObject from .cdm_object_ref import CdmObjectReference from .cdm_trait_collection import CdmTraitCollection if TYPE_CHECKING: - from cdm.objectmodel import CdmCorpusContext, CdmTraitDefinition, CdmTraitReference + from cdm.objectmodel import CdmCorpusContext from cdm.resolvedmodel import ResolvedTraitSetBuilder - from cdm.utilities import ResolveOptions, VisitCallback + from cdm.utilities import VisitCallback class CdmObjectDefinition(CdmObject): diff --git a/objectModel/Python/cdm/storage/storage_manager.py b/objectModel/Python/cdm/storage/storage_manager.py index 198d0234a9..4db8031680 100644 --- a/objectModel/Python/cdm/storage/storage_manager.py +++ b/objectModel/Python/cdm/storage/storage_manager.py @@ -191,12 +191,14 @@ def create_absolute_corpus_path(self, object_path: str, obj: 'CdmObject' = None) prefix = None namespace_from_obj = None - if obj and hasattr(obj, 'namespace') and hasattr(obj, 'folder_path'): - prefix = obj._folder_path - namespace_from_obj = obj._namespace - elif obj and obj.in_document: - prefix = obj.in_document._folder_path - namespace_from_obj = obj.in_document._namespace + if obj: + obj_doc = getattr(obj, "owner", obj) + if hasattr(obj_doc, 'namespace') and hasattr(obj_doc, 'folder_path'): + prefix = obj_doc.folder_path + namespace_from_obj = obj_doc.namespace + elif obj.in_document: + prefix = obj.in_document._folder_path + namespace_from_obj = obj.in_document._namespace if prefix and self._contains_unsupported_path_format(prefix): # Already called status_rpt when checking for unsupported path format.