liran-funaro / objsize

Traversal over Python's objects subtree and calculate the total size of the subtree in bytes (deep size).

Home Page:https://liran-funaro.github.io/objsize/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

objsize 0.6.0 release breaks Apache Beam

lukecwik opened this issue · comments

tox -c tox.ini -e py37 -- apache_beam/transforms/stats_test.py::ApproximateUniqueTest_0

fails with:

objsize.py
    exclude_set.update(id(vars(m)) for m in list(sys.modules.values()))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

.0 = <list_iterator object at 0x7fbe55e89410>

>   exclude_set.update(id(vars(m)) for m in list(sys.modules.values()))
E   TypeError: vars() argument must have __dict__ attribute [while running 'Globally/CombineGlobally(ApproximateQuantilesCombineFn)/InjectDefault']

The test adds the mmh3_options module to sys.modules which I suspect causes vars to fail since mmh3_options is not an object.

Thanks.
Version 0.6.1 fixes this issue.

@lukecwik Is this issues resolved. Did you migrate to the latest version?

Thanks for fixing this.