Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve options and deprecation warnings #327

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions objectModel/Python/cdm/objectmodel/cdm_object_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
14 changes: 8 additions & 6 deletions objectModel/Python/cdm/storage/storage_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down