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

Python SDK: Add strict mode #1477

Merged
merged 9 commits into from
Mar 2, 2023
Merged

Python SDK: Add strict mode #1477

merged 9 commits into from
Mar 2, 2023

Conversation

emilk
Copy link
Member

@emilk emilk commented Mar 2, 2023

This adds a strict mode to our Python SDK where misuses of the API results in exceptions being raised.

This is disabled by default for our users. In our examples it is enabled by default.

Checklist

This replaces explicit checks with a decorator.

This decorator declaration preserves type information
in Python 3.8 in my VSCode, which was a problem with previous attempts.

In a follow-up PR we can add a try-catch to the decorator to prevent
errors from bubbling up to the user.
@emilk emilk added the 🐍 Python API Python logging API label Mar 2, 2023
@emilk emilk marked this pull request as ready for review March 2, 2023 18:15
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

log_decorator <3

rerun_py/rerun_sdk/rerun/__init__.py Outdated Show resolved Hide resolved
rerun_py/rerun_sdk/rerun/__init__.py Outdated Show resolved Hide resolved
rerun_py/rerun_sdk/rerun/__init__.py Outdated Show resolved Hide resolved
rerun_py/rerun_sdk/rerun/__init__.py Outdated Show resolved Hide resolved
@emilk emilk merged commit 684a070 into main Mar 2, 2023
@emilk emilk deleted the emilk/catch-python-exceptions branch March 2, 2023 19:07
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.

2 participants