transaction
Functionality for extended lakeFS transactions to conduct versioning operations between file uploads.
Placeholder
dataclass
¶
Bases: Generic[T]
, ObjectProxy
A generic placeholder for a value computed by the lakeFS server in a versioning operation during a transaction.
Source code in src/lakefs_spec/transaction.py
LakeFSTransaction ¶
Bases: Transaction
A lakeFS transaction model capable of versioning operations in between file uploads.
PARAMETER | DESCRIPTION |
---|---|
fs |
The lakeFS file system associated with the transaction.
TYPE:
|
Source code in src/lakefs_spec/transaction.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
|
commit ¶
commit(
repository: str, branch: str, message: str, metadata: dict[str, str] | None = None
) -> Placeholder[Commit]
Create a commit on a branch in a repository with a commit message and attached metadata.
PARAMETER | DESCRIPTION |
---|---|
repository |
The repository to create the commit in.
TYPE:
|
branch |
The name of the branch to commit on.
TYPE:
|
message |
The commit message to attach to the newly created commit.
TYPE:
|
metadata |
Optional metadata to enrich the created commit with (author, e-mail, etc.).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Placeholder[Commit]
|
A placeholder for the commit created by the dispatched |
Source code in src/lakefs_spec/transaction.py
complete ¶
Finish the transaction by unwinding the file/versioning op stack via
- Committing or discarding in case of a file, and
- Conducting versioning operations using the file system's client.
No operations happen and all files are discarded if commit == False
,
which is the case, e.g., if an exception happens in the context manager.
PARAMETER | DESCRIPTION |
---|---|
commit |
Whether to conduct operations queued in the transaction.
TYPE:
|
Source code in src/lakefs_spec/transaction.py
create_branch ¶
Create a branch name
in a repository, branching off source_branch
.
PARAMETER | DESCRIPTION |
---|---|
repository |
Repository name.
TYPE:
|
name |
Name of the branch to be created.
TYPE:
|
source_branch |
Name of the source branch that the new branch is created from.
TYPE:
|
exist_ok |
Ignore creation errors if the branch already exists.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
The requested branch name. |
Source code in src/lakefs_spec/transaction.py
merge ¶
Merge a branch into another branch in a repository.
PARAMETER | DESCRIPTION |
---|---|
repository |
Name of the repository.
TYPE:
|
source_ref |
Source reference containing the changes to merge. Can be a branch name or partial commit SHA.
TYPE:
|
into |
Target branch into which the changes will be merged.
TYPE:
|
Source code in src/lakefs_spec/transaction.py
revert ¶
Revert a previous commit on a branch.
PARAMETER | DESCRIPTION |
---|---|
repository |
Name of the repository.
TYPE:
|
branch |
Branch on which the commit should be reverted.
TYPE:
|
parent_number |
If there are multiple parents to a commit, specify to which parent the commit should be reverted.
TYPE:
|
Source code in src/lakefs_spec/transaction.py
rev_parse ¶
Parse a given reference or any of its parents in a repository.
PARAMETER | DESCRIPTION |
---|---|
repository |
Name of the repository.
TYPE:
|
ref |
Commit SHA or commit placeholder object to resolve.
TYPE:
|
parent |
Optionally parse a parent of
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Placeholder[Commit]
|
A placeholder for the commit created by the dispatched |
Source code in src/lakefs_spec/transaction.py
tag ¶
Create a tag referencing a commit in a repository.
PARAMETER | DESCRIPTION |
---|---|
repository |
Name of the repository.
TYPE:
|
ref |
Commit SHA or placeholder for a commit object to which the new tag will point.
TYPE:
|
tag |
Name of the tag to be created.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
The name of the requested tag. |