Skip to content

Conversation

@bogdankostic
Copy link
Contributor

Related Issues

Proposed Changes:

This PR adds the custom loader CustomPythonLoader for pydoc-markdown and sets it as the loader for all documentation config files. CustomPythonLoader extends PythonLoader in such a way that the loaded classes not only contain the methods that are directly defined in them, but also their inherited methods from parent classes. The inherited methods are added recursively to make sure to display methods from all inheritance levels, not just direct inheritance.

As an example, here is the generated file for DocumentStore API docs: document_store_api.md

How did you test it?

I manually ran the pydoc-markdown.sh script.

Notes for the reviewer

There was a formatting error in Pipeline.run docstring, so I needed to fix that.

Checklist

@bogdankostic bogdankostic requested a review from a team as a code owner July 4, 2023 16:13
@bogdankostic bogdankostic requested review from anakin87 and removed request for a team July 4, 2023 16:13
@github-actions github-actions bot added the type:documentation Improvements on the docs label Jul 4, 2023
@coveralls
Copy link
Collaborator

coveralls commented Jul 4, 2023

Pull Request Test Coverage Report for Build 5456810715

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 43.864%

Totals Coverage Status
Change from base Build 5454588927: 0.0%
Covered Lines: 10094
Relevant Lines: 23012

💛 - Coveralls

Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

In general, this PR looks good to me. 👍

Let's just figure out if we want to use this opportunity to hide abstract classes/methods and avoid duplication...

@bogdankostic
Copy link
Contributor Author

Let's just figure out if we want to use this opportunity to hide abstract classes/methods and avoid duplication...

I would tackle this in a separate PR.

@bogdankostic
Copy link
Contributor Author

Let's wait until @dfokina is back to get her view on this topic.

@bogdankostic bogdankostic added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label Aug 2, 2023
# Conflicts:
#	docs/pydoc/config/document-store.yml
#	haystack/preview/pipeline.py
… into inherited_methods_api_reference

# Conflicts:
#	docs/pydoc/config/document-store.yml
@bogdankostic
Copy link
Contributor Author

This is how the DocumentStore API docs would look like if we would merge this PR now: document_store_api.md

@bogdankostic bogdankostic requested a review from anakin87 August 2, 2023 15:09
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

LGTM!

@bogdankostic bogdankostic merged commit a26859f into main Aug 2, 2023
@bogdankostic bogdankostic deleted the inherited_methods_api_reference branch August 2, 2023 16:54
DosticJelena pushed a commit to smartcat-labs/haystack that referenced this pull request Aug 23, 2023
…i#5273)

* Add inherited methods to API reference documentation

* Fix typing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release-notes PRs with this flag won't be included in the release notes. type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] run and run batch methods are missing from API

4 participants