Skip to content

Commit

Permalink
dont rely on strigified value for API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ozkatz committed Dec 9, 2023
1 parent a0c1011 commit f7c28d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions clients/python-wrapper/lakefs/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ def diff(self,
:raise NotAuthorizedException: if user is not authorized to perform this operation
:raise ServerException: for any other errors
"""
other_ref_id = other_ref
if isinstance(other_ref, Reference):
other_ref_id = other_ref.id
for diff in generate_listing(self._client.sdk_client.refs_api.diff_refs,
repository=self._repo_id,
left_ref=self._id,
right_ref=str(other_ref),
right_ref=other_ref_id,
after=after,
max_amount=max_amount,
prefix=prefix,
Expand All @@ -153,11 +156,13 @@ def merge_into(self, destination_branch_id: str | Reference, **kwargs) -> str:
:raise NotAuthorizedException: if user is not authorized to perform this operation
:raise ServerException: for any other errors
"""
if isinstance(destination_branch_id, Reference):
destination_branch_id = destination_branch_id.id
with api_exception_handler():
merge = lakefs_sdk.Merge(**kwargs)
res = self._client.sdk_client.refs_api.merge_into_branch(self._repo_id,
self._id,
str(destination_branch_id),
destination_branch_id,
merge=merge)
return res.reference

Expand Down

0 comments on commit f7c28d9

Please sign in to comment.