MCPcopy
hub / github.com/treeverse/dvc / get_obj

Method get_obj

dvc/output.py:912–937  ·  view source on GitHub ↗
(
        self, filter_info: Optional[str] = None, **kwargs
    )

Source from the content-addressed store, hash-verified

910 )
911
912 def get_obj(
913 self, filter_info: Optional[str] = None, **kwargs
914 ) -> Optional["HashFile"]:
915 obj: Optional[HashFile] = None
916 if self.obj:
917 obj = self.obj
918 elif self.files:
919 tree = Tree.from_list(self.files, hash_name=self.hash_name)
920 tree.digest()
921 obj = tree
922 elif self.hash_info:
923 try:
924 obj = oload(self.cache, self.hash_info)
925 except (FileNotFoundError, ObjectFormatError):
926 return None
927 else:
928 return None
929
930 assert obj
931 fs_path = self.fs
932 if filter_info and filter_info != self.fs_path:
933 prefix = fs_path.relparts(filter_info, self.fs_path)
934 assert isinstance(obj, Tree)
935 obj = obj.get_obj(self.cache, prefix)
936
937 return obj
938
939 def checkout(
940 self,

Callers 13

changed_cacheMethod · 0.95
dumpdMethod · 0.95
checkoutMethod · 0.95
get_files_numberMethod · 0.95
get_used_objsMethod · 0.95
_get_versioned_metaMethod · 0.95
_commit_granular_dirMethod · 0.80
_merge_push_metaFunction · 0.80
_load_data_from_outsFunction · 0.80
_build_tree_from_outsFunction · 0.80
_dumpdFunction · 0.80

Calls 1

relpartsMethod · 0.80

Tested by 1

test_updateMethod · 0.64