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

Add python bindings for new dataframe APIs #7357

Merged
merged 18 commits into from
Oct 4, 2024

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Sep 5, 2024

What

Example notebook for testing

pixi run py-build-examples
pixi run -e examples jupyter notebook tests/python/dataframe/examples.ipynb

Future work:

  • More docs / help strings
  • Remaining API features

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

Base automatically changed from jleibs/convert_to_record_batch to main September 9, 2024 19:32
@jleibs jleibs force-pushed the jleibs/python_dataframe_bindings branch from ae4f3f5 to 056a443 Compare September 16, 2024 20:46
@jleibs jleibs changed the base branch from main to jleibs/slice_based_queries September 16, 2024 20:47
@jleibs jleibs force-pushed the jleibs/slice_based_queries branch 2 times, most recently from abbe65b to 85c100c Compare September 18, 2024 16:38
Base automatically changed from jleibs/slice_based_queries to main September 18, 2024 19:09
@jleibs jleibs force-pushed the jleibs/python_dataframe_bindings branch 2 times, most recently from c8b7fa2 to 300e232 Compare September 19, 2024 00:34
@jleibs jleibs changed the base branch from main to jleibs/column_selectors September 19, 2024 11:33
Base automatically changed from jleibs/column_selectors to main September 19, 2024 16:30
@jleibs jleibs force-pushed the jleibs/python_dataframe_bindings branch 2 times, most recently from dd04745 to 6e35ed1 Compare October 2, 2024 23:54
@jleibs jleibs changed the title WIP: Add python bindings for new dataframe APIs Add python bindings for new dataframe APIs Oct 3, 2024
@jleibs jleibs marked this pull request as ready for review October 3, 2024 22:47
@teh-cmc teh-cmc self-requested a review October 4, 2024 07:29
rerun_py/rerun_bindings/rerun_bindings.pyi Outdated Show resolved Hide resolved
rerun_py/rerun_bindings/rerun_bindings.pyi Outdated Show resolved Hide resolved
rerun_py/rerun_bindings/rerun_bindings.pyi Outdated Show resolved Hide resolved
#[pyclass(frozen, name = "Schema")]
#[derive(Clone)]
pub struct PySchema {
// TODO(jleibs): This gets replaced with the new schema object
Copy link
Member

Choose a reason for hiding this comment

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

Guess it doesn't after all?

Copy link
Member Author

@jleibs jleibs Oct 4, 2024

Choose a reason for hiding this comment

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

I kind of feel like this goes away and these APIs move to the view? Punting that until after this PR either way.

rerun_py/src/dataframe.rs Outdated Show resolved Hide resolved
rerun_py/src/dataframe.rs Outdated Show resolved Hide resolved
rerun_py/src/dataframe.rs Outdated Show resolved Hide resolved
@jleibs jleibs force-pushed the jleibs/python_dataframe_bindings branch from 620f82c to b23fc65 Compare October 4, 2024 16:33
@jleibs jleibs merged commit 5da39a5 into main Oct 4, 2024
34 checks passed
@jleibs jleibs deleted the jleibs/python_dataframe_bindings branch October 4, 2024 17:22
@emilk
Copy link
Member

emilk commented Oct 17, 2024

This PR added a dependency on TypeAlias which was added in Python 3.10, making Rerun incompatible with earlier Rerun versions:

❯ python --version
Python 3.9.12

❯ python test.py /tmp/dna.rrd                                           
Traceback (most recent call last):
  File "/Users/emilk/code/rerun/test.py", line 2, in <module>
    import rerun as rr
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.9/site-packages/rerun_sdk/rerun/__init__.py", line 18, in <module>
    import rerun_bindings as bindings  # type: ignore[attr-defined]
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.9/site-packages/rerun_bindings/__init__.py", line 3, in <module>
    from typing import TYPE_CHECKING, TypeAlias, Union
ImportError: cannot import name 'TypeAlias' from 'typing' (/opt/homebrew/Caskroom/miniconda/base/lib/python3.9/typing.py)

@@ -0,0 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING, TypeAlias, Union
Copy link
Member

Choose a reason for hiding this comment

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

Why add these imports here?

I removed them in #7794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants