tensorflow / tensorflow/tensorboard

__getattr__ protocol not adhered to at module level

Open
#2,612 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core:notf stat:contributions welcome type:cleanup
Dominant language
TypeScript
Stars
7.2k
Forks
1.7k
Avg merge
4d 22h
Merged PRs (30d)
1

Description

Environment information (required)

Diagnostics output
--- check: autoidentify
INFO: diagnose_tensorboard.py version 393931f9685bd7e0f3898d7dcdf28819fef54c43

--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)
INFO: os.name: posix
INFO: os.uname(): posix.uname_result(sysname='Linux', nodename='bioeng187-pc', release='4.4.0-143-generic', version='#169-Ubuntu SMP Thu Feb 7 07:56:38 UTC 2019', machine='x86_64')
INFO: sys.getwindowsversion(): N/A

--- check: package_management
INFO: has conda-meta: True
INFO: $VIRTUAL_ENV: None

--- check: installed_packages
INFO: installed: tb-nightly==1.14.0a20190603
INFO: installed: tensorflow-gpu==2.0.0b0
INFO: installed: tf-estimator-nightly==1.14.0.dev2019060501

--- check: tensorboard_python_version
INFO: tensorboard.version.VERSION: '1.14.0a20190603'

--- check: tensorflow_python_version
INFO: tensorflow.__version__: '2.0.0-beta0'
INFO: tensorflow.__git_version__: 'v1.12.1-3259-gf59745a'

--- check: tensorboard_binary_path
INFO: which tensorboard: b'/home/localek10/miniconda3/bin/tensorboard\n'

--- check: readable_fqdn
INFO: socket.getfqdn(): 'bioeng187-pc.isd.kcl.ac.uk'

--- check: stat_tensorboardinfo
INFO: directory: /tmp/.tensorboard-info
INFO: .tensorboard-info directory does not exist

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['/home/localek10/miniconda3/lib/python3.7/site-packages']; bad_roots (0): []

--- check: full_pip_freeze
INFO: pip freeze --all:
absl-py==0.7.1
alabaster==0.7.12
asn1crypto==0.24.0
astor==0.8.0
astroid==2.2.5
attrs==19.1.0
Babel==2.7.0
backcall==0.1.0
bleach==3.1.0
blessings==1.7
blinker==1.4
certifi==2019.6.16
cffi==1.12.3
chardet==3.0.4
cloudpickle==1.2.1
conda==4.7.11
conda-package-handling==1.3.11
coverage==4.5.3
cryptography==2.7
cycler==0.10.0
decorator==4.4.0
defusedxml==0.6.0
docutils==0.15.2
entrypoints==0.3
gast==0.2.2
google-pasta==0.1.7
gpustat==0.6.0
grpcio==1.23.0
h5py==2.9.0
idna==2.8
imageio==2.5.0
imagesize==1.1.0
ipykernel==4.10.0
ipython==7.7.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
isort==4.3.21
jedi==0.15.1
jeepney==0.4
Jinja2==2.10.1
jsonschema==3.0.2
jupyter==1.0.0
jupyter-client==5.3.1
jupyter-console==6.0.0
jupyter-core==4.5.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
keyring==18.0.0
kiwisolver==1.1.0
lazy-object-proxy==1.4.1
libarchive-c==2.8
Markdown==3.1.1
MarkupSafe==1.1.1
matplotlib==3.1.0
mccabe==0.6.1
mistune==0.8.4
mkl-fft==1.0.14
mkl-random==1.0.2
mkl-service==2.0.2
nbconvert==5.5.0
nbformat==4.4.0
nibabel==2.5.0
notebook==6.0.0
numpy==1.16.4
numpydoc==0.9.1
nvidia-ml-py3==7.352.0
olefile==0.46
packaging==19.1
pandas==0.25.1
pandocfilters==1.4.2
parso==0.5.1
pexpect==4.7.0
pickleshare==0.7.5
Pillow==6.1.0
pip==19.1.1
prometheus-client==0.7.1
prompt-toolkit==2.0.9
protobuf==3.9.1
psutil==5.6.3
ptyprocess==0.6.0
pycodestyle==2.5.0
pycosat==0.6.3
pycparser==2.19
pyflakes==2.1.1
Pygments==2.4.2
pylint==2.3.1
pyOpenSSL==19.0.0
pyparsing==2.4.2
pyrsistent==0.14.11
PySocks==1.7.0
python-dateutil==2.8.0
pytz==2019.2
PyYAML==5.1.2
pyzmq==18.1.0
QtAwesome==0.5.7
qtconsole==4.5.4
QtPy==1.9.0
requests==2.22.0
rope==0.14.0
ruamel-yaml==0.15.46
scipy==1.3.1
SecretStorage==3.1.1
Send2Trash==1.5.0
setuptools==41.0.1
six==1.12.0
snowballstemmer==1.9.0
Sphinx==2.1.2
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
spyder==3.3.6
spyder-kernels==0.5.1
tb-nightly==1.14.0a20190603
tensorflow-gpu==2.0.0b0
termcolor==1.1.0
terminado==0.8.2
testpath==0.4.2
tf-estimator-nightly==1.14.0.dev2019060501
torch==1.2.0
tornado==6.0.3
tqdm==4.32.1
traitlets==4.3.2
urllib3==1.24.2
virtualenv==16.0.0
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.15.5
wheel==0.33.4
widgetsnbextension==3.5.1
wrapt==1.11.2
wurlitzer==1.0.3

Issue description

The use of __getattr__ at the module level is not compliant with the specification in places. One place is https://github.com/tensorflow/tensorboard/blob/a22566561d2b4fea408755a951ac9eaf3a156f8e/tensorboard/compat/tensorflow_stub/pywrap_tensorflow.py#L35

This returns 0 always which is not correct, it should return a found member or raise AttributeError. Returning 0 does not play well with other code doing module searching for example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading tensorboard/compat/tensorflow_stub/pywrap_tensorflow.py at the referenced getattr implementation and compare its behavior with the module-level getattr specification. Done means existing members are returned and missing members raise AttributeError instead of returning 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.