(entity, props)
| 237 | |
| 238 | |
| 239 | def assert_has_metadata(entity, props): |
| 240 | for k, v in props.items(): |
| 241 | actual = entity.metadata.get(k) |
| 242 | # Convert PyArrow arrays and other array-like objects to lists for comparison |
| 243 | if hasattr(actual, "to_pylist"): |
| 244 | actual = actual.to_pylist() |
| 245 | elif hasattr(actual, "tolist"): |
| 246 | actual = actual.tolist() |
| 247 | assert actual == v, f"Expected metadata {k!r} to be {v!r}, but got {actual!r}" |
| 248 | |
| 249 | |
| 250 | def expect_unify_error(fn): |