Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Wrapper: Objects generator #7110

Merged
merged 4 commits into from
Dec 5, 2023

Conversation

N-o-Z
Copy link
Member

@N-o-Z N-o-Z commented Dec 3, 2023

Closes #7109

Change Description

Background

Implement object generator and separate ObjecStats into ObjectInfo, CommonPrefix

Testing Details

Unit and integration tests

@N-o-Z N-o-Z added exclude-changelog PR description should not be included in next release changelog python-wrapper labels Dec 3, 2023
@N-o-Z N-o-Z requested a review from guy-har December 3, 2023 21:01
@N-o-Z N-o-Z self-assigned this Dec 3, 2023
@N-o-Z N-o-Z marked this pull request as ready for review December 3, 2023 21:01
@N-o-Z N-o-Z force-pushed the task/python-wrapper-objects-generator-7109 branch from 17883de to 6dffbca Compare December 3, 2023 21:11
@N-o-Z N-o-Z force-pushed the task/python-wrapper-objects-generator-7109 branch from 042814a to ddb7746 Compare December 5, 2023 08:05
Copy link
Contributor

@guy-har guy-har left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks,
Not blocking on any of my comments, but do take a look

@@ -9,6 +9,9 @@

from lakefs.namedtuple import LenientNamedTuple

_PREFIX = "common_prefix"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's not from this PR, but I prefer common_prefix, prefix has a different meaning

Suggested change
_PREFIX = "common_prefix"
_COMMON_PREFIX = "common_prefix"

Comment on lines +94 to +99
class CommonPrefix(LenientNamedTuple):
"""
Represents a common prefix in lakeFS
"""
path: str

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's still wanted, but on the initial PRD CommonPrefix has an exists method

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, both ObjectInfo and CommonPrefix are data models and do not contain logic. For now it feels redundant providing them with functionality that is accessible via the branch / object level methods. Lets see if there's demand for that and add it as needed

"""
Returns a ObjectManager object for this reference
Returns an object generator for this reference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object/common_prefix or find a better way to phrase it (even though the name of the method is objects)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add more doc information

@N-o-Z N-o-Z enabled auto-merge (squash) December 5, 2023 20:51
@N-o-Z N-o-Z merged commit 6972ce5 into master Dec 5, 2023
34 checks passed
@N-o-Z N-o-Z deleted the task/python-wrapper-objects-generator-7109 branch December 5, 2023 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-changelog PR description should not be included in next release changelog python-wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python Wrapper: Implement objects generators
2 participants