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

bug: issue with repr in list types #218

Open
tlambert03 opened this issue Sep 23, 2023 · 0 comments
Open

bug: issue with repr in list types #218

tlambert03 opened this issue Sep 23, 2023 · 0 comments

Comments

@tlambert03
Copy link
Owner

tlambert03 commented Sep 23, 2023

when getting repr on OME.structured_annotations

File ~/mambaforge/envs/ome-types/lib/python3.11/site-packages/rich/pretty.py:887, in traverse(_object, max_length, max_string, max_depth)
    884     node.is_namedtuple = _is_namedtuple(obj)
    885     return node
--> 887 node = _traverse(_object, root=True)
    888 return node

File ~/mambaforge/envs/ome-types/lib/python3.11/site-packages/rich/pretty.py:683, in traverse.<locals>._traverse(obj, root, depth)
    681 push_visited(obj_id)
    682 angular = getattr(obj.__rich_repr__, "angular", False)
--> 683 args = list(iter_rich_args(rich_repr_result))
    684 class_name = obj.__class__.__name__
    686 if args:

File ~/mambaforge/envs/ome-types/lib/python3.11/site-packages/rich/pretty.py:650, in traverse.<locals>._traverse.<locals>.iter_rich_args(rich_args)
    649 def iter_rich_args(rich_args: Any) -> Iterable[Union[Any, Tuple[str, Any]]]:
--> 650     for arg in rich_args:
    651         if _safe_isinstance(arg, tuple):
    652             if len(arg) == 3:

File ~/mambaforge/envs/ome-types/lib/python3.11/site-packages/pydantic/_internal/_repr.py:72, in Representation.__rich_repr__(self)
     70 def __rich_repr__(self) -> RichReprResult:
     71     """Used by Rich (https://rich.readthedocs.io/en/stable/pretty.html) to pretty print objects."""
---> 72     for name, field_repr in self.__repr_args__():
     73         if name is None:
     74             yield field_repr

File ~/dev/self/ome-types/src/ome_types/_mixins/_base_type.py:136, in OMEType.__repr_args__(self)
    134 """Repr with only set values, and truncated sequences."""
    135 args = []
--> 136 for k, v in model_dump(self, exclude_defaults=True).items():
    137     if k == "kind":
    138         continue

AttributeError: 'list' object has no attribute 'items'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant