Skip to content

Remove deprecated Python APIs: log_components, connect, connect_tcp #9197

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

Merged
merged 9 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/content/reference/migration/migration-0-23.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,10 @@ Either:

The former is subject to (double-precision) floating point precision loss (still microsecond precision for the next century), while the latter is lossless.

## 🐍 Python: removed `rr.log_components()`, `rr.connect()`, and `rr.connect_tcp()`

These functions were [deprecated](migration-0-22.md#python-api-changes) in 0.22 and are no longer available.

Calls to `rr.log_components()` API are now superseded by the new partial update API. See the [documentation](../../concepts/latest-at.md#partial-updates) and the [migration instructions](migration-0-22.md#partial-updates).

Calls to `rr.connect()` and `rr.connect_tcp()` must be changed to [`rr.connect_grpc()`](https://ref.rerun.io/docs/python/0.22.1/common/initialization_functions/#rerun.connect_grpc?speculative-link).
1 change: 0 additions & 1 deletion rerun_py/docs/gen_common_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class Section:
title="Initialization functions",
func_list=[
"init",
"connect",
"connect_grpc",
"disconnect",
"save",
Expand Down
2 changes: 0 additions & 2 deletions rerun_py/rerun_sdk/rerun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
IndicatorComponentBatch as IndicatorComponentBatch,
escape_entity_path_part as escape_entity_path_part,
log as log,
log_components as log_components,
log_file_from_contents as log_file_from_contents,
log_file_from_path as log_file_from_path,
new_entity_path as new_entity_path,
Expand Down Expand Up @@ -171,7 +170,6 @@
script_teardown as script_teardown,
)
from .sinks import (
connect as connect,
connect_grpc as connect_grpc,
disconnect as disconnect,
save as save,
Expand Down
64 changes: 0 additions & 64 deletions rerun_py/rerun_sdk/rerun/_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import pyarrow as pa
import rerun_bindings as bindings
from typing_extensions import deprecated

from ._baseclasses import AsComponents, ComponentDescriptor, DescribedComponentBatch
from .error_utils import _send_warning_or_raise, catch_and_log_exceptions
Expand Down Expand Up @@ -171,69 +170,6 @@ def log(
)


@deprecated(
"""Use `log` with partial update APIs instead.
See: https://www.rerun.io/docs/reference/migration/migration-0-22 for more details.""",
)
@catch_and_log_exceptions()
def log_components(
entity_path: str | list[str],
components: Iterable[DescribedComponentBatch],
*,
static: bool = False,
recording: RecordingStream | None = None,
strict: bool | None = None,
) -> None:
r"""
Log an entity from a collection of `ComponentBatchLike` objects.

See also: [`rerun.log`][].

Parameters
----------
entity_path:
Path to the entity in the space hierarchy.

The entity path can either be a string
(with special characters escaped, split on unescaped slashes)
or a list of unescaped strings.
This means that logging to `"world/my\ image\!"` is the same as logging
to ["world", "my image!"].

See <https://www.rerun.io/docs/concepts/entity-path> for more on entity paths.

components:
A collection of `ComponentBatchLike` objects.

static:
If true, the components will be logged as static data.

Static data has no time associated with it, exists on all timelines, and unconditionally shadows
any temporal data of the same type.

Otherwise, the data will be timestamped automatically with `log_time` and `log_tick`.
Additional timelines set by [`rerun.set_index`][] will also be included.

recording:
Specifies the [`rerun.RecordingStream`][] to use. If left unspecified,
defaults to the current active data recording, if there is one. See
also: [`rerun.init`][], [`rerun.set_global_data_recording`][].

strict:
If True, raise exceptions on non-loggable data.
If False, warn on non-loggable data.
if None, use the global default from `rerun.strict_mode()`

"""

_log_components(
entity_path=entity_path,
components=list(components),
static=static,
recording=recording, # NOLINT
)


def _log_components(
entity_path: str | list[str],
components: list[DescribedComponentBatch],
Expand Down
37 changes: 0 additions & 37 deletions rerun_py/rerun_sdk/rerun/blueprint/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Optional, Union

import rerun_bindings as bindings
from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from .._baseclasses import AsComponents, ComponentBatchLike
from .._spawn import _spawn_viewer
Expand Down Expand Up @@ -568,42 +567,6 @@ def _ipython_display_(self) -> None:

Viewer(blueprint=self).display()

@deprecated(
"""Please migrate to `connect_grpc(…)`.
See: https://www.rerun.io/docs/reference/migration/migration-0-22 for more details.""",
)
def connect(
self,
application_id: str,
*,
url: str | None = None,
make_active: bool = True,
make_default: bool = True,
) -> None:
"""
Connect to a remote Rerun Viewer on the given HTTP(S) URL and send this blueprint.

Parameters
----------
application_id:
The application ID to use for this blueprint. This must match the application ID used
when initiating rerun for any data logging you wish to associate with this blueprint.
url:
The HTTP(S) URL to connect to
make_active:
Immediately make this the active blueprint for the associated `app_id`.
Note that setting this to `false` does not mean the blueprint may not still end
up becoming active. In particular, if `make_default` is true and there is no other
currently active blueprint.
make_default:
Make this the default blueprint for the `app_id`.
The default blueprint will be used as the template when the user resets the
blueprint for the app. It will also become the active blueprint if no other
blueprint is currently active.

"""
return self.connect_grpc(application_id, url=url, make_active=make_active, make_default=make_default)

def connect_grpc(
self,
application_id: str,
Expand Down
6 changes: 3 additions & 3 deletions rerun_py/rerun_sdk/rerun/recording_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def new_recording(
If you only need a single global recording, [`rerun.init`][] might be simpler.

Note that unless setting `spawn=True` new recording streams always begin connected to a buffered sink.
To send the data to a viewer or file you will likely want to call [`rerun.connect`][] or [`rerun.save`][]
To send the data to a viewer or file you will likely want to call [`rerun.connect_grpc`][] or [`rerun.save`][]
explicitly.

!!! Warning
Expand Down Expand Up @@ -331,7 +331,7 @@ class RecordingStream:
- Metadata-related functions:
[`rerun.is_enabled`][], [`rerun.get_recording_id`][], …
- Sink-related functions:
[`rerun.connect`][], [`rerun.spawn`][], …
[`rerun.connect_grpc`][], [`rerun.spawn`][], …
- Time-related functions:
[`rerun.set_index`][], [`rerun.disable_timeline`][], [`rerun.reset_time`][], …
- Log-related functions:
Expand Down Expand Up @@ -529,7 +529,7 @@ def disconnect(self) -> None:
Closes all TCP connections, servers, and files.

Closes all TCP connections, servers, and files that have been opened with
[`rerun.connect`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`].
[`rerun.connect_grpc`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`].
"""

from .sinks import disconnect
Expand Down
92 changes: 1 addition & 91 deletions rerun_py/rerun_sdk/rerun/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,96 +25,6 @@ def is_recording_enabled(recording: RecordingStream | None) -> bool:
return bindings.is_enabled() # type: ignore[no-any-return]


@deprecated(
"""Please migrate to `connect_grpc(…)`.
See: https://www.rerun.io/docs/reference/migration/migration-0-22 for more details.""",
)
def connect(
addr: str | None = None,
*,
flush_timeout_sec: float | None = 2.0,
default_blueprint: BlueprintLike | None = None,
recording: RecordingStream | None = None,
) -> None:
"""
Connect to a remote Rerun Viewer on the given ip:port.

This function returns immediately.

Parameters
----------
addr:
The ip:port to connect to
flush_timeout_sec:
The minimum time the SDK will wait during a flush before potentially
dropping data if progress is not being made. Passing `None` indicates no timeout,
and can cause a call to `flush` to block indefinitely.
default_blueprint:
Optionally set a default blueprint to use for this application. If the application
already has an active blueprint, the new blueprint won't become active until the user
clicks the "reset blueprint" button. If you want to activate the new blueprint
immediately, instead use the [`rerun.send_blueprint`][] API.
recording:
Specifies the [`rerun.RecordingStream`][] to use.
If left unspecified, defaults to the current active data recording, if there is one.
See also: [`rerun.init`][], [`rerun.set_global_data_recording`][].

"""
if addr is not None:
addr = f"rerun+http://{addr}/proxy"
return connect_grpc(
url=addr,
flush_timeout_sec=flush_timeout_sec,
default_blueprint=default_blueprint,
recording=recording, # NOLINT: conversion not needed
)


@deprecated(
"""Please migrate to `connect_grpc(…)`.
See: https://www.rerun.io/docs/reference/migration/migration-0-22 for more details.""",
)
def connect_tcp(
addr: str | None = None,
*,
flush_timeout_sec: float | None = 2.0,
default_blueprint: BlueprintLike | None = None,
recording: RecordingStream | None = None,
) -> None:
"""
Connect to a remote Rerun Viewer on the given ip:port.

This function returns immediately.

Parameters
----------
addr:
The ip:port to connect to
flush_timeout_sec:
The minimum time the SDK will wait during a flush before potentially
dropping data if progress is not being made. Passing `None` indicates no timeout,
and can cause a call to `flush` to block indefinitely.
default_blueprint:
Optionally set a default blueprint to use for this application. If the application
already has an active blueprint, the new blueprint won't become active until the user
clicks the "reset blueprint" button. If you want to activate the new blueprint
immediately, instead use the [`rerun.send_blueprint`][] API.
recording:
Specifies the [`rerun.RecordingStream`][] to use.
If left unspecified, defaults to the current active data recording, if there is one.
See also: [`rerun.init`][], [`rerun.set_global_data_recording`][].

"""
if addr is not None:
addr = f"rerun+http://{addr}/proxy"
return connect_grpc(
url=addr,
flush_timeout_sec=flush_timeout_sec,
default_blueprint=default_blueprint,
recording=recording, # NOLINT: conversion not needed
)


def connect_grpc(
url: str | None = None,
*,
Expand Down Expand Up @@ -287,7 +197,7 @@ def disconnect(recording: RecordingStream | None = None) -> None:
Closes all TCP connections, servers, and files.

Closes all TCP connections, servers, and files that have been opened with
[`rerun.connect`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`].
[`rerun.connect_grpc`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`].

Parameters
----------
Expand Down
Loading