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

DOCS: Missing Docstrings in public API #1056

Open
1 of 3 tasks
sungwy opened this issue Aug 13, 2024 · 2 comments
Open
1 of 3 tasks

DOCS: Missing Docstrings in public API #1056

sungwy opened this issue Aug 13, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@sungwy
Copy link
Collaborator

sungwy commented Aug 13, 2024

Feature Request / Improvement

As we prepare for a major release, I think it would be great to hold our public APIs to a higher standard of documentation.

Many popular public classes, methods and functions are currently missing docstrings.

Here are some examples:

class Table:
_identifier: Identifier = Field()
metadata: TableMetadata
metadata_location: str = Field()
io: FileIO
catalog: Catalog
def __init__(
self, identifier: Identifier, metadata: TableMetadata, metadata_location: str, io: FileIO, catalog: Catalog
) -> None:
self._identifier = identifier
self.metadata = metadata
self.metadata_location = metadata_location
self.io = io
self.catalog = catalog

def scan(
self,
row_filter: Union[str, BooleanExpression] = ALWAYS_TRUE,
selected_fields: Tuple[str, ...] = ("*",),
case_sensitive: bool = True,
snapshot_id: Optional[int] = None,
options: Properties = EMPTY_DICT,
limit: Optional[int] = None,
) -> DataScan:
return DataScan(
table_metadata=self.metadata,
io=self.io,
row_filter=row_filter,
selected_fields=selected_fields,
case_sensitive=case_sensitive,
snapshot_id=snapshot_id,
options=options,
limit=limit,
)

I think that the Google style guide for Comments and Docstrings is a good start, as it has a easily human-readable format that includes description, args, returns and exceptions that is also Sphinx parse-able (if we ever decide to autogenerate API docs that way in the future)

TODO:

@sungwy sungwy added the documentation Improvements or additions to documentation label Aug 13, 2024
@sungwy sungwy added this to the PyIceberg 1.0.0 milestone Aug 13, 2024
@geekusa33
Copy link

Can I try this one? Just for clarification it looks like #1190 is completed, but #1191 is needed?

@sungwy
Copy link
Collaborator Author

sungwy commented Sep 26, 2024

Hi @askalik - yes, that'll be amazing! If you leave a comment on #1191 I can get that assigned to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants