zcollection.collection.Collection.copy#

Collection.copy(target, *, filters=None, filesystem=None, mode='w', npartitions=None, synchronizer=None)[source]#

Copy the collection to a new location.

Parameters:
  • target (str) – The target location.

  • filters (str | Callable[[Dict[str, int]], bool] | None) – The predicate used to filter the partitions to copy.

  • filesystem (AbstractFileSystem | None) – The file system to use. If None, the file system of the collection is used.

  • mode (Literal['r', 'w']) – The mode used to open the collection copied. Default is ‘w’.

  • npartitions (int | None) – The number of partitions top copy in parallel. Default is number of cores.

  • synchronizer (Sync | None) – The synchronizer used to synchronize the collection copied. Default is None.

Returns:

The new collection.

Return type:

Collection

Example

>>> import zcollection
>>> collection = zcollection.open_collection(
...     "my_collection", mode="r")
>>> collection.copy(target="my_new_collection")