-
Notifications
You must be signed in to change notification settings - Fork 202
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: Add docstrings for Identifier, Properties, RecursiveDict #1530
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this.
Looks like there's a linter issue in CI, you can fix it by running make lint
locally.
Also, it would be helpful to see the rendered doc page for these fields along with showing that it is hyperlinked in create_table_if_not_exists
f3bd4a6
to
f21a448
Compare
The issue with the linter is that it does not allow docstrings to appear after the variable. For this code:
The linter fails with:
If I change to:
the linter fails with:
Any ideas as to the best way forward? |
Docstrings must definitely be written below attribute assignments for mkdocstrings to pick them up. I'd recommend disabling this lint rule as it apparently doesn't support code with several docstrings at the module-level (which is something Python itself happily deals with, using only the first docstring as the module's |
I see what you are saying. It looks like this issue has come up before: This project chose to remove the check-docstring-first pre-commit hook: Do you suggest that pyiceberg do the same? |
@rodrigc do note that I'm just a passer-by! I have no authority here 😄 I'm the maintainer of mkdocstrings and found this issue while stalking a bit, just wanted to help 🙂 I understand it's not great to just drop the lint rule (because it can be helpful), but I'm not sure if there's a better rule out there 🤷 I don't use pre-commit (the tool) myself. |
Looks like #1531 is merged, could you rebase this PR? |
This allows mkdocstrings to generate hyperlinks to these types in the documentation. Fixes: apache#1529
f21a448
to
62f352f
Compare
I rebased this PR. Do you have any further suggestions for improving the docstrings for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Properties
and RecursiveDict
are pretty generic types so the current docstring looks good to me
Could you add some screenshots to the PR description showing the hyperlink? |
Amazing, thank you! |
This allows mkdocstrings to generate hyperlinks
to these types in the documentation.
Fixes: #1529