d1_python icon indicating copy to clipboard operation
d1_python copied to clipboard

Add missing d1_client import to download_mn_objects

Open r-b-g-b opened this issue 1 year ago • 0 comments

Environment details

Python 3.12

pip freeze | grep dataone
: dataone.common==3.5.2
: dataone.libclient==3.5.2
: dataone.util==3.5.2

To reproduce

pip install dataone.util dataone.libclient
import d1_client
import d1_util
base_url = 'https://example.com/metacat/d1/mn'  # I used a real DataONE member node here
r = d1_util.download_mn_objects.MemberNodeObjectDownloader(base_url, '/home/robert/Downloads/mn_dl')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/robert/anaconda3/envs/cib/lib/python3.12/site-packages/d1_util/download_mn_objects.py", line 133, in __init__
    self._mn_client = d1_client.mnclient.MemberNodeClient(base_url)
                      ^^^^^^^^^
NameError: name 'd1_client' is not defined

I think it's as simple as a missing import d1_client.mnclient at the top of download_mn_objects. (The d1_client is already a requirement in setup.py.)

r-b-g-b avatar Dec 17 '24 15:12 r-b-g-b