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

Tickets/dm 48149 #921

Merged
merged 2 commits into from
Dec 14, 2024
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
1 change: 1 addition & 0 deletions doc/news/DM-48149.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated TopicInfo to no longer raise an exception when data arrays lenght are different from the defined in the xml. This will now issue a warning but will no longer fail.
Copy link
Contributor

Choose a reason for hiding this comment

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

lenght -> length

6 changes: 4 additions & 2 deletions python/lsst/ts/xml/topic_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import hashlib
import json
import typing
import warnings
from xml.etree import ElementTree

from .field_info import FieldInfo
Expand Down Expand Up @@ -368,8 +369,9 @@ def validate(
if len(getattr(model, field_name)) != array_fields[field_name]
]
if bad_arrays:
raise ValueError(
f"Array fields with incorrect length: {bad_arrays}"
warnings.warn(
f"Array fields with incorrect length: {bad_arrays}. "
"This used to be an error condition in past versions of salobj."
)

dataclass = dataclasses.make_dataclass(
Expand Down
Loading