Skip to content

objectron Python example is broken #2557

@emilk

Description

@emilk
❯ python --version
Python 3.8.12

❯ pip install -r examples/python/objectron/requirements.txt
…

❯ examples/python/objectron/main.py                        
DEV ENVIRONMENT DETECTED! Re-importing rerun from: /Users/emilk/code/rerun/rerun/rerun_py/rerun_sdk
DEV ENVIRONMENT DETECTED! Re-importing rerun from: /Users/emilk/code/rerun/rerun/rerun_py/rerun_sdk
loading annotations from /Users/emilk/code/rerun/rerun/examples/python/objectron/dataset/book/batch-20/35/annotation.pbdata
Traceback (most recent call last):
  File "examples/python/objectron/main.py", line 294, in <module>
    main()
  File "examples/python/objectron/main.py", line 287, in main
    seq = read_annotations(dir)
  File "examples/python/objectron/main.py", line 101, in read_annotations
    seq = Sequence().parse(data)
  File "<string>", line 5, in __init__
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 528, in __post_init__
    setattr(self, field.name, self._get_field_default(field, meta))
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 652, in _get_field_default
    return self._betterproto.default_gen[field.name]()
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 563, in _betterproto
    meta = ProtoClassMetadata(self.__class__)
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 457, in __init__
    self.init_default_gen()
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 465, in init_default_gen
    default_gen[field.name] = self.cls._get_field_default_gen(field, meta)
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 658, in _get_field_default_gen
    t = cls._type_hint(field.name)
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 640, in _type_hint
    type_hints = get_type_hints(cls, vars(module))
  File "/Users/emilk/.pyenv/versions/3.8.12/lib/python3.8/typing.py", line 1232, in get_type_hints
    value = _eval_type(value, base_globals, localns)
  File "/Users/emilk/.pyenv/versions/3.8.12/lib/python3.8/typing.py", line 270, in _eval_type
    return t._evaluate(globalns, localns)
  File "/Users/emilk/.pyenv/versions/3.8.12/lib/python3.8/typing.py", line 518, in _evaluate
    eval(self.__forward_code__, globalns, localns),
  File "<string>", line 1, in <module>
TypeError: 'type' object is not subscriptable

Metadata

Metadata

Assignees

No one assigned

    Labels

    examplesIssues relating to the Rerun examplessdk-pythonPython logging API🪳 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions