AttributeError when running example code
Created by: Joscha
When I run the code from the tutorial I get an AttributeError: 'NoneType' object has no attribute ‘lower'
. Am I doing something wrong?
Code
import caosdb as db
conn = db.configure_connection(
url="https://demo.indiscale.com/",
password_method="plain",
username="admin",
password="caosdb")
print(conn)
response = db.execute_query("FIND RECORD Guitar”)
Traceback
File "/Users/jsc/Code/Projects/caosdb-test/caosdb-test.py", line 16, in <module>
response = db.execute_query("FIND RECORD Guitar")
File "/Users/jsc/miniconda3/envs/caosdb-test/lib/python3.8/site-packages/caosdb/common/models.py", line 3770, in execute_query
return query.execute(unique=unique,
File "/Users/jsc/miniconda3/envs/caosdb-test/lib/python3.8/site-packages/caosdb/common/models.py", line 3710, in execute
cresp = Container._response_to_entities(http_response)
File "/Users/jsc/miniconda3/envs/caosdb-test/lib/python3.8/site-packages/caosdb/common/models.py", line 2567, in _response_to_entities
e = _parse_single_xml_element(child)
File "/Users/jsc/miniconda3/envs/caosdb-test/lib/python3.8/site-packages/caosdb/common/models.py", line 3955, in _parse_single_xml_element
return Query(elem)
File "/Users/jsc/miniconda3/envs/caosdb-test/lib/python3.8/site-packages/caosdb/common/models.py", line 3668, in __init__
self.cached = q.get("cached").lower() == "true"
AttributeError: 'NoneType' object has no attribute 'lower'
Environment:
❯ conda list
# packages in environment at /Users/jsc/miniconda3/envs/caosdb-test:
#
# Name Version Build Channel
appnope 0.1.2 py38hecd8cb5_1001
backcall 0.2.0 pyhd3eb1b0_0
ca-certificates 2021.1.19 hecd8cb5_0
caosdb 0.5.0 pypi_0 pypi
certifi 2020.12.5 py38hecd8cb5_0
decorator 4.4.2 pyhd3eb1b0_0
future 0.18.2 pypi_0 pypi
ipykernel 5.3.4 py38h5ca1d4c_0
ipython 7.20.0 py38h01d92e1_1
ipython_genutils 0.2.0 pyhd3eb1b0_1
jedi 0.17.0 py38_0
jupyter_client 6.1.7 py_0
jupyter_core 4.7.1 py38hecd8cb5_0
libcxx 10.0.0 1
libedit 3.1.20191231 h1de35cc_1
libffi 3.3 hb1e8313_2
libsodium 1.0.18 h1de35cc_0
lxml 4.6.2 pypi_0 pypi
ncurses 6.2 h0a44026_1
openssl 1.1.1i h9ed2024_0
parso 0.8.1 pyhd3eb1b0_0
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
pip 20.3.3 py38hecd8cb5_0
prompt-toolkit 3.0.8 py_0
ptyprocess 0.7.0 pyhd3eb1b0_2
pygments 2.7.4 pyhd3eb1b0_0
pysocks 1.7.1 pypi_0 pypi
python 3.8.5 h26836e1_1
python-dateutil 2.8.1 pyhd3eb1b0_0
pyyaml 5.4.1 pypi_0 pypi
pyzmq 20.0.0 py38h23ab428_1
readline 8.1 h9ed2024_0
setuptools 52.0.0 py38hecd8cb5_0
six 1.15.0 py38hecd8cb5_0
sqlite 3.33.0 hffcf06c_0
tk 8.6.10 hb0a8c7a_0
tornado 6.1 py38h9ed2024_0
traitlets 5.0.5 pyhd3eb1b0_0
tzdata 2020f h52ac0ba_0
wcwidth 0.2.5 py_0
wheel 0.36.2 pyhd3eb1b0_0
xz 5.2.5 h1de35cc_0
zeromq 4.3.3 hb1e8313_3
zlib 1.2.11 h1de35cc_3
Imported comments:
By Timm Fitschen on 2021-02-12T15:37:19.500Z
For your information: We also updated the demo server. It should work with both versions now, v0.5.1 and v0.5.0
By Timm Fitschen on 2021-02-12T15:33:41.887Z
Fixed with !53 (merged) See https://pypi.org/project/caosdb/ for latest pypi package
By Henrik tom Wörden on 2021-02-12T13:26:54.086Z
mentioned in merge request !53 (merged)
By Timm Fitschen on 2021-02-12T11:51:24.860Z
@jschmiedt thank you very much for your report. No, you didn't do anything wrong. Apparently, the demo-server is not up-to-date and you are using the pylib 0.5.0 (which was published yesterday).
Apologies for the inconvenience!
By Henrik tom Wörden on 2021-02-12T11:39:23.913Z
assigned to @henrik_indiscale