https://lakefs.io/ logo
Title
c

Conor Simmons

01/31/2023, 3:03 PM
Hey, I have another question: is there any way to get the branch associated with a commit number in the Python SDK? I was hoping get_commit might have this in the response data but I haven't seen it in there
e

Elad Lachmi

01/31/2023, 3:11 PM
Hi @Conor Simmons, I'm not sure that there is, but let me verify that
👍 1
c

Conor Simmons

01/31/2023, 3:15 PM
Thanks!
e

Elad Lachmi

01/31/2023, 3:21 PM
It looks like the
parent
property would be the branch, but let me make sure
@Conor Simmons Sorry,
parent
is a ref to the previous commit in the log lakeFS doesn't currently support looking up a branch from a commit
c

Conor Simmons

01/31/2023, 3:39 PM
Ok. Another workaroud I thought of would be to list all the commits under a given branch and search for the desired commit. I don't think there's a way to get this either though? Only the most recent commit?
e

Elad Lachmi

01/31/2023, 3:48 PM
log_commits
(which replaces the deprecated
log_branch_commits
) can take a branch as a ref and return it's commit log
I agree that it's possible to roll your own commit lookup this way
c

Conor Simmons

01/31/2023, 4:11 PM
Thanks @Elad Lachmi that works for me!
e

Elad Lachmi

01/31/2023, 4:12 PM
Sure, np