Mixins

Client

PFS Helper

class Commit(repo, branch=None, id=None, repo_type='user', project='default')[source]

Bases: tuple

A namedtuple subclass to specify a Commit.

Attributes
branch

Alias for field number 1

id

Alias for field number 2

project

Alias for field number 4

repo

Alias for field number 0

repo_type

Alias for field number 3

Methods

count(value, /)

Return number of occurrences of value.

from_pb(commit)

Converts a pfs_pb2.Commit object into a Commit object.

index(value[, start, stop])

Return first index of value.

to_pb()

Converts itself into a pfs_pb2.Commit.

property branch

Alias for field number 1

static from_pb(commit)[source]

Converts a pfs_pb2.Commit object into a Commit object.

property id

Alias for field number 2

property project

Alias for field number 4

property repo

Alias for field number 0

property repo_type

Alias for field number 3

to_pb()[source]

Converts itself into a pfs_pb2.Commit.

SubcommitType

Composite type for a subcommit, a commit at the repo-level.

Examples

Tuple:

>>> sc = ("foo", "master")
>>> sc2 = ("foo", "467c580611234cdb8cc9758c7aa96087")

Dict:

>>> sc = {repo: "foo", branch: "master", repo_type: "spec"}

Commit:

>>> from python_pachyderm.pfs import Commit
>>> sc = Commit(repo="foo", branch="master")

pfs_pb2.Commit:

>>> from python_pachyderm.service import pfs_proto
>>> sc = pfs_pb2.Commit(
...     branch=pfs_pb2.Branch(
...         repo=pfs_pb2.Repo(name="foo", type="user"),
...         name="master",
...     )
... )

alias of Union[tuple, dict, python_pachyderm.pfs.Commit, python_pachyderm.proto.v2.pfs.pfs_pb2.Commit]

commit_from(commit=None)[source]

A commit can be identified by (repo, branch, commit_id, repo_type)

Helper function to convert objects that represent a Commit query into a protobuf Commit object.

Parameters
commitSubcommitType, optional

The commit representation to convert to a protobuf commit object.

Returns
pfs_pb2.Commit

A protobuf object that represents a commit.

Util Helper

Experimental Module