MCPcopy Create free account
hub / github.com/aws/aws-cli / load_data_with_path

Method load_data_with_path

awscli/botocore/loaders.py:420–436  ·  view source on GitHub ↗

Same as ``load_data`` but returns file path as second return value. :type name: str :param name: The data path, i.e ``ec2/2015-03-01/service-2``. :return: Tuple of the loaded data and the path to the data file where the data was loaded from. If no data could be

(self, name)

Source from the content-addressed store, hash-verified

418
419 @instance_cache
420 def load_data_with_path(self, name):
421 """Same as ``load_data`` but returns file path as second return value.
422
423 :type name: str
424 :param name: The data path, i.e ``ec2/2015-03-01/service-2``.
425
426 :return: Tuple of the loaded data and the path to the data file
427 where the data was loaded from. If no data could be found then a
428 DataNotFoundError is raised.
429 """
430 for possible_path in self._potential_locations(name):
431 found = self.file_loader.load_file(possible_path)
432 if found is not None:
433 return found, possible_path
434
435 # We didn't find anything that matched on any path.
436 raise DataNotFoundError(data_path=name)
437
438 def load_data(self, name):
439 """Load data given a data path.

Calls 3

_potential_locationsMethod · 0.95
DataNotFoundErrorClass · 0.90
load_fileMethod · 0.45