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(algolia): add custom attributes to backend and core methods #9730

Merged
merged 5 commits into from
Jul 31, 2024

Conversation

gforsyth
Copy link
Member

@gforsyth gforsyth commented Jul 30, 2024

There are several (mostly linked) improvements here:

  • docs(algolia): add custom attributes to backend and core methods

Adds 2 custom attributes, one which notes whether the method is part of
the core API (not on a backend), the other which holds the name of the
backend.

We then have an algolia ranking setup where we use the value of
core (descending) to break ties, so Table.drop will show up above RandomBackend.drop

  • fix(quartodoc): search up through BaseBackend for docstrings

The above fix exposed a bunch of empty docstrings for many backend methods inheriting from a grandparent class object.

We were looking at the resolved_bases to find docstrings that were
defined in a parent class, but this search only goes up a single level
of inheritance. For all of our sql-based backends, this means we only
go up to SQLBackend, not BaseBackend.

Manually adding BaseBackend to the resolution list fills out a LOT of
missing docstrings on the backend docs pages.

  • fix(quartodoc): don't render deprecated schema methods

Having done that, we were now successfully rendering schema methods that are deprecated and we don't want to advertise, so I turned that off.

  • fix(quartodoc): don't duplicate entries in resolved_bases

It was possible for these resolved_bases to get duplicated, so I stopped that.

  • feat(algolia): configure custom algolia ranking

A lot of algolia config happens in their web UI, which I don't like because it makes it hard to know what we've changed.
This automates the custom ranking that makes use of the new attribute core added in the first commit.

I also moved all of the algolia scripts to a directory to keep them together since that collection keeps growing.

gforsyth added 5 commits July 30, 2024 16:56
Adds 2 custom attributes, one which notes whether the method is part of
the core API (not on a backend), the other which holds the name of the
backend.

We then have an algolia ranking setup where we use the value of
`core` (descending) to break ties, so `Table.drop` will show up above `RandomBackend.drop`
We were looking at the `resolved_bases` to find docstrings that were
defined in a parent class, but this search only goes up a single level
of inheritance.  For all of our sql-based backends, this means we only
go up to `SQLBackend`, not `BaseBackend`.

Manually adding `BaseBackend` to the resolution list fills out a LOT of
missing docstrings on the backend docs pages.
@gforsyth gforsyth added docs Documentation related issues or PRs developer-tools Tools related to ibis development labels Jul 30, 2024
for base in cls.resolved_bases:
resolved_bases = cls.resolved_bases
# If we're a SQLBackend (likely) then also search through to `BaseBackend``
if (sqlbackend := resolved_bases[0]).name == "SQLBackend":
Copy link
Member

Choose a reason for hiding this comment

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

Is there a more generic fix for this, like altering the lookup code to traverse the class hierarchy?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but I think it's upstream in quartodoc. I'm going to take a peak at what's involved

Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

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

LGTM! Just a non-blocking question.

@cpcloud cpcloud merged commit d9473cf into ibis-project:main Jul 31, 2024
100 checks passed
@gforsyth gforsyth deleted the more_search_improvements branch July 31, 2024 12:30
gforsyth added a commit to gforsyth/ibis that referenced this pull request Jul 31, 2024
Follow-up to ibis-project#9730.

I fixed adding the parent docstrings in the rendered docs, but those
weren't showing up in the search summary on Algolia.  They do now.
@cpcloud cpcloud added this to the 9.3 milestone Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-tools Tools related to ibis development docs Documentation related issues or PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants