Skip to content

Prep 6.7.0 #1949

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
Feb 6, 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
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# -- Project information -----------------------------------------------------

project = 'Python SDK reference'
copyright = '2024, Labelbox'
copyright = '2025, Labelbox'
author = 'Labelbox'
release = '6.6.0'
release = '6.7.0'

# -- General configuration ---------------------------------------------------

Expand Down
5 changes: 5 additions & 0 deletions libs/labelbox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
# Version 6.7.0 (2025-02-06)
## Added
* MAL support for pdf relationships (beta)([#1932](https://github.com/Labelbox/labelbox-python/pull/1932))
* Allow setting read_only for relationships (beta)([#1950](https://github.com/Labelbox/labelbox-python/pull/1950))

# Version 6.6.0 (2025-01-14)
## Added
* Support for python 3.13([#1940](https://github.com/Labelbox/labelbox-python/pull/1940))
Expand Down
2 changes: 1 addition & 1 deletion libs/labelbox/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "labelbox"
version = "6.6.0"
version = "6.7.0"
description = "Labelbox Python API"
authors = [{ name = "Labelbox", email = "engineering@labelbox.com" }]
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion libs/labelbox/src/labelbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "labelbox"

__version__ = "6.6.0"
__version__ = "6.7.0"

from labelbox.client import Client
from labelbox.schema.annotation_import import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Type(Enum):
type: Type = Type.UNIDIRECTIONAL
readonly: Optional[bool] = None

@model_validator(mode='after')
@model_validator(mode="after")
def check_readonly(self):
if self.readonly is True:
warnings.warn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class _Relationship(BaseModel):
type: str
readonly: Optional[bool] = None


class NDRelationship(NDAnnotation):
relationship: _Relationship

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,10 @@ def test_relationship_readonly_explicit_true():
value=TextEntity(start=30, end=35),
)

with pytest.warns(UserWarning, match="Creating a relationship with readonly=True is in beta.*"):
with pytest.warns(
UserWarning,
match="Creating a relationship with readonly=True is in beta.*",
):
relationship = RelationshipAnnotation(
name="rel",
value=Relationship(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,27 @@ def test_readonly_relationships():
)

# Verify readonly relationship
assert readonly_rel_serialized["relationship"]["source"] == ner_source_serialized["uuid"]
assert readonly_rel_serialized["relationship"]["target"] == ner_target_serialized["uuid"]
assert (
readonly_rel_serialized["relationship"]["source"]
== ner_source_serialized["uuid"]
)
assert (
readonly_rel_serialized["relationship"]["target"]
== ner_target_serialized["uuid"]
)
assert readonly_rel_serialized["relationship"]["type"] == "unidirectional"
assert readonly_rel_serialized["relationship"]["readonly"] is True

# Verify non-readonly relationship
assert non_readonly_rel_serialized["relationship"]["source"] == ner_source_serialized["uuid"]
assert non_readonly_rel_serialized["relationship"]["target"] == ner_target_serialized["uuid"]
assert non_readonly_rel_serialized["relationship"]["type"] == "bidirectional"
assert (
non_readonly_rel_serialized["relationship"]["source"]
== ner_source_serialized["uuid"]
)
assert (
non_readonly_rel_serialized["relationship"]["target"]
== ner_target_serialized["uuid"]
)
assert (
non_readonly_rel_serialized["relationship"]["type"] == "bidirectional"
)
assert non_readonly_rel_serialized["relationship"]["readonly"] is False
Loading