-
Notifications
You must be signed in to change notification settings - Fork 608
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
Conversation
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.
docs/backends/_utils.py
Outdated
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": |
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.
Is there a more generic fix for this, like altering the lookup code to traverse the class hierarchy?
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.
Yes, but I think it's upstream in quartodoc. I'm going to take a peak at what's involved
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! Just a non-blocking question.
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.
There are several (mostly linked) improvements here:
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, soTable.drop
will show up aboveRandomBackend.drop
BaseBackend
for docstringsThe 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 weredefined 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
, notBaseBackend
.Manually adding
BaseBackend
to the resolution list fills out a LOT ofmissing docstrings on the backend docs pages.
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.
It was possible for these resolved_bases to get duplicated, so I stopped that.
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.