Skip to content

Conversation

@jleibs
Copy link
Member

@jleibs jleibs commented Nov 12, 2025

Related

What

Mostly making sure I understand the shim plumbing and fixing things so I get correct typing in vs code.

I know there are downsides to using multiple inheritance like this, but, I wanted to see what it would look like if TableEntry just acted like a dataframe with a few Entry-related extras.

@jleibs jleibs requested review from abey79 and timsaucer November 12, 2025 19:41
@jleibs jleibs added sdk-python Python logging API exclude from changelog PRs with this won't show up in CHANGELOG.md labels Nov 12, 2025
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

Web viewer built successfully.

Result Commit Link Manifest
1dec6c1 https://rerun.io/viewer/pr/11880 +nightly +main

View image diff on kitdiff.

Note: This comment is updated whenever you push a commit.

Copy link
Member

@abey79 abey79 left a comment

Choose a reason for hiding this comment

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

I obviously get shills up my spine with the multiple inheritance thing, but this is the point of this sandbox, so lgtm

Comment on lines +88 to +91
if url is None:
tmpdir = tempfile.TemporaryDirectory()
self.tmpdirs.append(tmpdir)
url = Path(tmpdir.name).as_uri()
Copy link
Member

Choose a reason for hiding this comment

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

I love the utter nastiness we are allowed in here 😅



class TableEntry(Entry):
class TableEntry(Entry, datafusion.DataFrame):
Copy link
Member

Choose a reason for hiding this comment

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

As far as this PR goes, I'm obviously open to experimentation and this is fine. As for API design, I unsurprisingly the opposite of in love with this though 😅 Multiple inheritance is obviously broken in man ways, but it feels particularly nasty when one of the base class is outside of the control of the project. For example, append and update could easily conflict with future datafusion apis.

Suggested change
class TableEntry(Entry, datafusion.DataFrame):
# TODO(RR-2939): can we do better than multiple inheritance?
class TableEntry(Entry, datafusion.DataFrame):

return TableEntry(self._inner.register_table(name, url))

def create_table_entry(self, name: str, schema, url: str) -> TableEntry:
def create_table(self, name: str, schema, url: str | None = None) -> TableEntry:
Copy link
Member

Choose a reason for hiding this comment

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

Note: we tried to establish the convention that: xyz would return "raw data" (aka dataframe), while xyz_entry returns the python object representation. We couldn't really make it super consistent, but the df/object hybrid obviously doesn't help here.

@jleibs jleibs merged commit 3f8c9f8 into main Nov 13, 2025
38 checks passed
@jleibs jleibs deleted the jleibs/draft_table_apis branch November 13, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exclude from changelog PRs with this won't show up in CHANGELOG.md sdk-python Python logging API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants