Skip to content

Simplify datafile metadata resolution order

Compare
Choose a tag to compare
@github-actions github-actions released this 02 May 13:30
e78370c

Summary

This release simplifies the Datafile class internals and clarifies its metadata resolution order. Stored metadata will now be used in preference to instantiation metadata unless the hypothetical parameter is True, allowing the removal of some confusing internal logic from the class.

Contents (#433)

Enhancements

  • If hypothetical is not True when re-instantiating existing datafiles, always use their stored metadata (from the cloud object or local metadata file)
  • Store cloud metadata on Datafile instances without the octue__ namespace prefix in its keys
  • Make Datafile metadata update methods public so they can be called easily by users
  • Make it optional whether to include the SDK version in the output of Datafile.metadata
  • Return None from GoogleCloudStorageClient.get_metadata if bucket not found instead of raising an error

Fixes

  • Allow instantiation of a cloud datafile with a non-existent or inaccessible cloud path (defer raising errors until attempting to access it)

Refactoring

  • Simplify Datafile internals by removing the "initialisation parameters" concept
  • Rename Datafile._get_local_metadata to Datafile._use_local_metadata
  • Align Datafile._use_cloud_metadata and Datafile._use_local_metadata methods
  • Factor out setting Datafile instance metadata from stored metadata into _set_metadata method