Skip to content

RecordingStream monkey-patched functions result in mypy errors #5445

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

Closed
jleibs opened this issue Mar 8, 2024 · 0 comments · Fixed by #9182
Closed

RecordingStream monkey-patched functions result in mypy errors #5445

jleibs opened this issue Mar 8, 2024 · 0 comments · Fixed by #9182
Labels
😤 annoying Something in the UI / SDK is annoying to use 🐍 Python API Python logging API

Comments

@jleibs
Copy link
Member

jleibs commented Mar 8, 2024

We money-patch a bunch of helpers into the RecordingStream class, but in practice using these causes mypy to produce a bunch of errors.

For example

rerun_py/rerun_sdk/rerun/blueprint/api.py:77: error: "RecordingStream" has no attribute "log"  [attr-defined]
rerun_py/rerun_sdk/rerun/blueprint/api.py:84: error: "RecordingStream" has no attribute "log"  [attr-defined]
rerun_py/rerun_sdk/rerun/blueprint/api.py:184: error: "RecordingStream" has no attribute "log"  [attr-defined]
rerun_py/rerun_sdk/rerun/blueprint/api.py:292: error: "RecordingStream" has no attribute "log"  [attr-defined]
rerun_py/rerun_sdk/rerun/blueprint/api.py:314: error: "RecordingStream" has no attribute "set_time_seconds"  [attr-defined]
rerun_py/rerun_sdk/rerun/blueprint/api.py:318: error: Returning Any from function declared to return "MemoryRecording"  [no-any-return]
rerun_py/rerun_sdk/rerun/blueprint/api.py:318: error: "RecordingStream" has no attribute "memory_recording"  [attr-defined]

Now that we've introduced code-gen into other parts of our code-base, we should consider just code-genning these helpers to cut down on runtime shenanigans and bring us proper type signatures.

@jleibs jleibs added 🐍 Python API Python logging API 😤 annoying Something in the UI / SDK is annoying to use labels Mar 8, 2024
@abey79 abey79 closed this as completed in 678caad Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant