Skip to content

Commit 322f74e

Browse files
Add conversion of dict to string during Qtable construction (spacetelescope#348)
1 parent 1fd9ef5 commit 322f74e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
- Replaced the previous test for ``schema_info`` with something more robust. [#344]
77

8+
- Add conversion of dict to string during Qtable construction [#348]
9+
810
0.19.1 (2024-04-04)
911
===================
1012

src/roman_datamodels/datamodels/_datamodels.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def append_individual_image_meta(self, meta):
9090

9191
subtable_cols.append(subkey)
9292

93-
if isinstance(subvalue, list):
93+
if isinstance(subvalue, (list, dict)):
9494
subtable_vals.append([str(subvalue)])
9595
else:
9696
subtable_vals.append([subvalue])
@@ -105,11 +105,13 @@ def append_individual_image_meta(self, meta):
105105
else:
106106
# Append to existing table
107107
self.meta.individual_image_meta[key].add_row(subtable_vals)
108+
# Skip non-schema metas
109+
elif isinstance(value, dict):
110+
continue
111+
# Skip ndarrays
112+
elif isinstance(value.strip(), asdf.tags.core.ndarray.NDArrayType):
113+
continue
108114
else:
109-
# Skip ndarrays
110-
if isinstance(value.strip(), asdf.tags.core.ndarray.NDArrayType):
111-
continue
112-
113115
# Store Basic keyword
114116
basic_cols.append(key)
115117

0 commit comments

Comments
 (0)