Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result_xfm in Dataset.status() seems broken #7545

Open
psadil opened this issue Dec 27, 2023 · 2 comments
Open

result_xfm in Dataset.status() seems broken #7545

psadil opened this issue Dec 27, 2023 · 2 comments

Comments

@psadil
Copy link

psadil commented Dec 27, 2023

What is the problem?

There seems to be a documentation issue or a bug in Dataset.status(). The api has a result_xfm option "metadata", but using that in a typical setting raises an exception (one of the results is None, whereas custom_result_summary_renderer assumes that the input has a get method).

What steps will reproduce the problem?

import tempfile
from pathlib import Path

import datalad.api as dapi

with tempfile.TemporaryDirectory() as tmpd:
    ds = dapi.Dataset(tmpd)
    ds.create()
    (Path(tmpd) / "file").write_text("x" * 1000)
    ds.save()
    ds.status(result_xfm="metadata")
create(ok): . (dataset)
add(ok): file (file)                                                                                                                                                                                                  
save(ok): . (dataset)                                                                                                                                                                                                 
action summary:                                                                                                                                                                                                       
  add (ok: 1)
  save (ok: 1)
Traceback (most recent call last):
  File "/private/tmp/broken.py", line 11, in <module>
    ds.status(result_xfm="metadata")
  File "/Users/psadil/mambaforge/envs/ukb/lib/python3.11/site-packages/datalad/distribution/dataset.py", line 507, in apply_func
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/psadil/mambaforge/envs/ukb/lib/python3.11/site-packages/datalad/interface/base.py", line 773, in eval_func
    return return_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/psadil/mambaforge/envs/ukb/lib/python3.11/site-packages/datalad/interface/base.py", line 763, in return_func
    results = list(results)
              ^^^^^^^^^^^^^
  File "/Users/psadil/mambaforge/envs/ukb/lib/python3.11/site-packages/datalad/interface/base.py", line 930, in _execute_command_
    interface.custom_result_summary_renderer(*summary_args)
  File "/Users/psadil/mambaforge/envs/ukb/lib/python3.11/site-packages/datalad/core/local/status.py", line 463, in custom_result_summary_renderer
    annexed = [
              ^
  File "/Users/psadil/mambaforge/envs/ukb/lib/python3.11/site-packages/datalad/core/local/status.py", line 466, in <listcomp>
    if r.get('action', None) == 'status' \
       ^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

DataLad information

> datalad --version
datalad 0.19.3
> datalad wtf
# WTF
## configuration <SENSITIVE, report disabled by configuration>
## credentials 
  - keyring: 
    - active_backends: 
      - macOS Keyring
      - PlaintextKeyring with no encyption v.1.0 at /Users/psadil/.local/share/python_keyring/keyring_pass.cfg
    - config_file: /Users/psadil/.config/python_keyring/keyringrc.cfg
    - data_root: /Users/psadil/.local/share/python_keyring
## datalad 
  - version: 0.19.3
## dependencies 
  - annexremote: 1.2.1
  - boto: 2.49.0
  - cmd:7z: 16.02
  - cmd:annex: 10.20231129
  - cmd:bundled-git: UNKNOWN
  - cmd:git: 2.43.0
  - cmd:ssh: 9.4p1
  - cmd:system-git: 2.43.0
  - cmd:system-ssh: 9.4p1
  - humanize: 4.9.0
  - iso8601: 2.1.0
  - keyring: 24.3.0
  - keyrings.alt: 4.2.0
  - msgpack: 1.0.7
  - platformdirs: 4.1.0
  - requests: 2.31.0
## environment 
  - LANG: en_US.UTF-8
  - PATH: /Users/psadil/ants/install/bin:/Users/psadil/afni/install:/Users/psadil/mambaforge/envs/ukb/bin:/Users/psadil/mambaforge/condabin:/Users/psadil/fsl/share/fsl/bin:/Users/psadil/fsl/share/fsl/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/hatch/bin:/Applications/quarto/bin:/Users/psadil/Applications/quarto/bin:/Users/psadil/.local/bin:/Users/psadil/.local/bin
## extensions 
  - ukbiobank: 
    - description: UKBiobank dataset support
    - entrypoints: 
      - datalad_ukbiobank.init.Init: 
        - class: Init
        - module: datalad_ukbiobank.init
        - names: 
          - ukb-init
          - ukb_init
      - datalad_ukbiobank.update.Update: 
        - class: Update
        - module: datalad_ukbiobank.update
        - names: 
          - ukb-update
          - ukb_update
    - module: datalad_ukbiobank
    - version: 0.3.5.1
## git-annex 
  - build flags: 
    - Assistant
    - Webapp
    - Pairing
    - FsEvents
    - TorrentParser
    - MagicMime
    - Benchmark
    - Feeds
    - Testsuite
    - S3
    - WebDAV
  - dependency versions: 
    - aws-0.24.1
    - bloomfilter-2.0.1.2
    - crypton-0.34
    - DAV-1.3.4
    - feed-1.3.2.1
    - ghc-9.6.3
    - http-client-0.7.15
    - persistent-sqlite-2.13.2.0
    - torrent-10000.1.3
    - uuid-1.3.15
    - yesod-1.6.2.1
  - key/value backends: 
    - SHA256E
    - SHA256
    - SHA512E
    - SHA512
    - SHA224E
    - SHA224
    - SHA384E
    - SHA384
    - SHA3_256E
    - SHA3_256
    - SHA3_512E
    - SHA3_512
    - SHA3_224E
    - SHA3_224
    - SHA3_384E
    - SHA3_384
    - SKEIN256E
    - SKEIN256
    - SKEIN512E
    - SKEIN512
    - BLAKE2B256E
    - BLAKE2B256
    - BLAKE2B512E
    - BLAKE2B512
    - BLAKE2B160E
    - BLAKE2B160
    - BLAKE2B224E
    - BLAKE2B224
    - BLAKE2B384E
    - BLAKE2B384
    - BLAKE2BP512E
    - BLAKE2BP512
    - BLAKE2S256E
    - BLAKE2S256
    - BLAKE2S160E
    - BLAKE2S160
    - BLAKE2S224E
    - BLAKE2S224
    - BLAKE2SP256E
    - BLAKE2SP256
    - BLAKE2SP224E
    - BLAKE2SP224
    - SHA1E
    - SHA1
    - MD5E
    - MD5
    - WORM
    - URL
    - X*
  - operating system: darwin aarch64
  - remote types: 
    - git
    - gcrypt
    - p2p
    - S3
    - bup
    - directory
    - rsync
    - web
    - bittorrent
    - webdav
    - adb
    - tahoe
    - glacier
    - ddar
    - git-lfs
    - httpalso
    - borg
    - hook
    - external
  - supported repository versions: 
    - 8
    - 9
    - 10
  - upgrade supported from repository versions: 
    - 0
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    - 10
  - version: 10.20231129
## location 
  - path: /private/tmp
  - type: directory
## metadata.extractors 
## metadata.filters 
## metadata.indexers 
## python 
  - implementation: CPython
  - version: 3.11.6
## system 
  - distribution: darwin/23.2.0 14.2.1/arm64
  - encoding: 
    - default: utf-8
    - filesystem: utf-8
    - locale.prefered: UTF-8
  - filesystem: 
    - CWD: 
      - max_pathlength: 1024
      - mount_opts: ro,local,rootfs,dovolfs,journaled,multilabel
      - path: /private/tmp
      - type: apfs
    - HOME: 
      - max_pathlength: 1024
      - mount_opts: ro,local,rootfs,dovolfs,journaled,multilabel
      - path: /Users/psadil
      - type: apfs
    - TMP: 
      - max_pathlength: 1024
      - mount_opts: ro,local,rootfs,dovolfs,journaled,multilabel
      - path: /var/folders/v_/kcpb096s1m3_37ctfd2sp2xm0000gn/T
      - type: apfs
  - max_path_length: 260
  - name: Darwin
  - release: 23.2.0
  - type: posix
  - version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000

Additional context

mamba env
❯ mamba env export
name: ukb
channels:
  - conda-forge
dependencies:
  - aiohttp=3.9.1=py311h05b510d_0
  - aiosignal=1.3.1=pyhd8ed1ab_0
  - aiosqlite=0.19.0=pyhd8ed1ab_0
  - alembic=1.13.0=pyhd8ed1ab_0
  - annexremote=1.2.1=py_0
  - annotated-types=0.6.0=pyhd8ed1ab_0
  - anyio=3.7.1=pyhd8ed1ab_0
  - appnope=0.1.3=pyhd8ed1ab_0
  - apprise=1.6.0=pyhd8ed1ab_0
  - argon2-cffi=23.1.0=pyhd8ed1ab_0
  - argon2-cffi-bindings=21.2.0=py311heffc1b2_4
  - arrow=1.3.0=pyhd8ed1ab_0
  - asgi-lifespan=2.1.0=pyhd8ed1ab_0
  - asttokens=2.4.1=pyhd8ed1ab_0
  - async-exit-stack=1.0.1=pyhd8ed1ab_0
  - async-lru=2.0.4=pyhd8ed1ab_0
  - async-timeout=4.0.3=pyhd8ed1ab_0
  - asyncpg=0.29.0=py311h05b510d_0
  - atk-1.0=2.38.0=hcb7b3dd_1
  - attrs=23.1.0=pyh71513ae_1
  - babel=2.13.1=pyhd8ed1ab_0
  - bcrypt=4.1.1=py311h94f323b_0
  - beautifulsoup4=4.12.2=pyha770c72_0
  - bleach=6.1.0=pyhd8ed1ab_0
  - blinker=1.7.0=pyhd8ed1ab_0
  - boto=2.49.0=py_0
  - brotli-python=1.1.0=py311ha891d26_1
  - bzip2=1.0.8=h93a5062_5
  - c-ares=1.23.0=h93a5062_0
  - ca-certificates=2023.11.17=hf0a4a13_0
  - cached-property=1.5.2=hd8ed1ab_1
  - cached_property=1.5.2=pyha770c72_1
  - cachetools=5.3.2=pyhd8ed1ab_0
  - cairo=1.18.0=hd1e100b_0
  - certifi=2023.11.17=pyhd8ed1ab_0
  - cffi=1.16.0=py311h4a08483_0
  - chardet=5.2.0=py311h267d04e_1
  - charset-normalizer=3.3.2=pyhd8ed1ab_0
  - click=8.1.7=unix_pyh707e725_0
  - cloudpickle=2.2.1=pyhd8ed1ab_0
  - colorama=0.4.6=pyhd8ed1ab_0
  - comm=0.1.4=pyhd8ed1ab_0
  - coolname=2.2.0=pyhd8ed1ab_0
  - croniter=1.4.1=pyhd8ed1ab_0
  - cryptography=41.0.7=py311h08c85a6_1
  - curl=8.5.0=h2d989ff_0
  - dataclasses=0.8=pyhc8e2a94_3
  - datalad=0.19.3=py311h267d04e_0
  - dateparser=1.2.0=pyhd8ed1ab_0
  - debugpy=1.8.0=py311ha891d26_1
  - decorator=5.1.1=pyhd8ed1ab_0
  - defusedxml=0.7.1=pyhd8ed1ab_0
  - distro=1.8.0=pyhd8ed1ab_0
  - docker-py=6.1.3=pyhd8ed1ab_0
  - entrypoints=0.4=pyhd8ed1ab_0
  - exceptiongroup=1.2.0=pyhd8ed1ab_0
  - executing=2.0.1=pyhd8ed1ab_0
  - exifread=3.0.0=pyhd8ed1ab_0
  - expat=2.5.0=hb7217d7_1
  - fasteners=0.17.3=pyhd8ed1ab_0
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=h77eed37_1
  - fontconfig=2.14.2=h82840c6_0
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - fqdn=1.5.1=pyhd8ed1ab_0
  - freetype=2.12.1=hadb7bae_2
  - fribidi=1.0.10=h27ca646_0
  - frozenlist=1.4.0=py311heffc1b2_1
  - fsspec=2023.12.1=pyhca7485f_0
  - gdk-pixbuf=2.42.10=h15fa40c_4
  - gettext=0.21.1=h0186832_0
  - giflib=5.2.1=h1a8c8d9_3
  - git=2.43.0=pl5321h6e320eb_0
  - google-auth=2.25.1=pyhca7485f_0
  - graphite2=1.3.13=h9f76cd9_1001
  - graphviz=9.0.0=h3face73_1
  - greenlet=3.0.2=py311hbaf5611_0
  - griffe=0.38.1=pyhd8ed1ab_0
  - gtk2=2.24.33=h57013de_2
  - gts=0.7.6=he42f4ea_4
  - h11=0.14.0=pyhd8ed1ab_0
  - h2=4.1.0=pyhd8ed1ab_0
  - harfbuzz=8.3.0=h8f0ba13_0
  - hpack=4.0.0=pyh9f0ad1d_0
  - httpcore=1.0.2=pyhd8ed1ab_0
  - httpx=0.25.2=pyhd8ed1ab_0
  - humanize=4.9.0=pyhd8ed1ab_0
  - hyperframe=6.0.1=pyhd8ed1ab_0
  - icu=73.2=hc8870d7_0
  - idna=3.6=pyhd8ed1ab_0
  - importlib-metadata=7.0.0=pyha770c72_0
  - importlib_metadata=7.0.0=hd8ed1ab_0
  - importlib_resources=6.1.1=pyhd8ed1ab_0
  - iniconfig=2.0.0=pyhd8ed1ab_0
  - ipykernel=6.26.0=pyh3cd1d5f_0
  - ipython=8.18.1=pyh707e725_3
  - ipywidgets=8.1.1=pyhd8ed1ab_0
  - iso8601=2.1.0=pyhd8ed1ab_0
  - isoduration=20.11.0=pyhd8ed1ab_0
  - jaraco.classes=3.3.0=pyhd8ed1ab_0
  - jedi=0.19.1=pyhd8ed1ab_0
  - jinja2=3.1.2=pyhd8ed1ab_1
  - json5=0.9.14=pyhd8ed1ab_0
  - jsonpatch=1.33=pyhd8ed1ab_0
  - jsonpointer=2.4=py311h267d04e_3
  - jsonschema=4.20.0=pyhd8ed1ab_0
  - jsonschema-specifications=2023.11.2=pyhd8ed1ab_0
  - jsonschema-with-format-nongpl=4.20.0=pyhd8ed1ab_0
  - jupyter=1.0.0=pyhd8ed1ab_10
  - jupyter-lsp=2.2.1=pyhd8ed1ab_0
  - jupyter_client=8.6.0=pyhd8ed1ab_0
  - jupyter_console=6.6.3=pyhd8ed1ab_0
  - jupyter_core=5.5.0=py311h267d04e_0
  - jupyter_events=0.9.0=pyhd8ed1ab_0
  - jupyter_server=2.12.1=pyhd8ed1ab_0
  - jupyter_server_terminals=0.4.4=pyhd8ed1ab_1
  - jupyterlab=4.0.9=pyhd8ed1ab_0
  - jupyterlab_pygments=0.3.0=pyhd8ed1ab_0
  - jupyterlab_server=2.25.2=pyhd8ed1ab_0
  - jupyterlab_widgets=3.0.9=pyhd8ed1ab_0
  - keyring=24.3.0=py311h267d04e_0
  - keyrings.alt=4.2.0=pyhd8ed1ab_0
  - krb5=1.21.2=h92f50d5_0
  - lcms2=2.16=ha0e7c42_0
  - lerc=4.0.0=h9a09cb3_0
  - libblas=3.9.0=20_osxarm64_openblas
  - libcblas=3.9.0=20_osxarm64_openblas
  - libcurl=8.5.0=h2d989ff_0
  - libcxx=16.0.6=h4653b0c_0
  - libdeflate=1.19=hb547adb_0
  - libedit=3.1.20191231=hc8eb9b7_2
  - libev=4.33=h93a5062_2
  - libexpat=2.5.0=hb7217d7_1
  - libffi=3.4.2=h3422bc3_5
  - libgd=2.3.3=hfdf3952_9
  - libgfortran=5.0.0=13_2_0_hd922786_1
  - libgfortran5=13.2.0=hf226fd6_1
  - libglib=2.78.2=hb438215_0
  - libiconv=1.17=he4db4b2_0
  - libjpeg-turbo=3.0.0=hb547adb_1
  - liblapack=3.9.0=20_osxarm64_openblas
  - libnghttp2=1.58.0=ha4dd798_1
  - libopenblas=0.3.25=openmp_h6c19121_0
  - libpng=1.6.39=h76d750c_0
  - librsvg=2.56.3=h55a2576_1
  - libsodium=1.0.18=h27ca646_1
  - libsqlite=3.44.2=h091b4b1_0
  - libssh2=1.11.0=h7a5bd25_0
  - libtiff=4.6.0=ha8a6c65_2
  - libwebp=1.3.2=hf30222e_1
  - libwebp-base=1.3.2=hb547adb_0
  - libxcb=1.15=hf346824_0
  - libxml2=2.12.2=h0d0cfa8_0
  - libzlib=1.2.13=h53f4e23_5
  - llvm-openmp=17.0.6=hcd81f8e_0
  - looseversion=1.3.0=pyhd8ed1ab_0
  - mako=1.3.0=pyhd8ed1ab_0
  - markdown=3.5.1=pyhd8ed1ab_0
  - markdown-it-py=3.0.0=pyhd8ed1ab_0
  - markupsafe=2.1.3=py311heffc1b2_1
  - matplotlib-inline=0.1.6=pyhd8ed1ab_0
  - mdurl=0.1.0=pyhd8ed1ab_0
  - mistune=3.0.2=pyhd8ed1ab_0
  - more-itertools=10.1.0=pyhd8ed1ab_0
  - msgpack-python=1.0.7=py311hd03642b_0
  - multidict=6.0.4=py311he2be06e_1
  - mutagen=1.47.0=pyhd8ed1ab_0
  - nbclient=0.8.0=pyhd8ed1ab_0
  - nbconvert=7.12.0=pyhd8ed1ab_0
  - nbconvert-core=7.12.0=pyhd8ed1ab_0
  - nbconvert-pandoc=7.12.0=pyhd8ed1ab_0
  - nbformat=5.9.2=pyhd8ed1ab_0
  - ncurses=6.4=h463b476_2
  - nest-asyncio=1.5.8=pyhd8ed1ab_0
  - notebook=7.0.6=pyhd8ed1ab_0
  - notebook-shim=0.2.3=pyhd8ed1ab_0
  - numpy=1.26.2=py311h6d074dd_0
  - oauthlib=3.2.2=pyhd8ed1ab_0
  - openjpeg=2.5.0=h4c1507b_3
  - openssl=3.2.0=h0d3ecfb_1
  - orjson=3.9.10=py311h69e6b7b_0
  - overrides=7.4.0=pyhd8ed1ab_0
  - p7zip=16.02=hbdafb3b_1001
  - packaging=23.2=pyhd8ed1ab_0
  - pandoc=3.1.3=hce30654_0
  - pandocfilters=1.5.0=pyhd8ed1ab_0
  - pango=1.50.14=hcf40dda_2
  - paramiko=3.3.1=pyhd8ed1ab_0
  - parso=0.8.3=pyhd8ed1ab_0
  - pathspec=0.11.2=pyhd8ed1ab_0
  - patool=2.0.0=pyhd8ed1ab_0
  - pcre2=10.42=h26f9a81_0
  - pendulum=2.1.2=py311heffc1b2_6
  - perl=5.32.1=4_hf2054a2_perl5
  - pexpect=4.8.0=pyh1a96a4e_2
  - pickleshare=0.7.5=py_1003
  - pillow=10.1.0=py311hb9c5795_0
  - pip=23.3.1=pyhd8ed1ab_0
  - pixman=0.42.2=h13dd4ca_0
  - pkgutil-resolve-name=1.3.10=pyhd8ed1ab_1
  - platformdirs=4.1.0=pyhd8ed1ab_0
  - pluggy=1.3.0=pyhd8ed1ab_0
  - polars=0.20.0=py311hcca7419_0
  - prefect=2.14.9=pyhd8ed1ab_0
  - prometheus_client=0.19.0=pyhd8ed1ab_0
  - prompt-toolkit=3.0.41=pyha770c72_0
  - prompt_toolkit=3.0.41=hd8ed1ab_0
  - psutil=5.9.5=py311heffc1b2_1
  - pthread-stubs=0.4=h27ca646_1001
  - ptyprocess=0.7.0=pyhd3deb0d_0
  - pure_eval=0.2.2=pyhd8ed1ab_0
  - pyasn1=0.5.1=pyhd8ed1ab_0
  - pyasn1-modules=0.3.0=pyhd8ed1ab_0
  - pycparser=2.21=pyhd8ed1ab_0
  - pydantic=2.5.2=pyhd8ed1ab_0
  - pydantic-core=2.14.5=py311h94f323b_0
  - pygments=2.17.2=pyhd8ed1ab_0
  - pyjwt=2.8.0=pyhd8ed1ab_0
  - pynacl=1.5.0=py311heffc1b2_3
  - pyobjc-core=10.1=py311h665608e_0
  - pyobjc-framework-cocoa=10.1=py311h665608e_0
  - pyopenssl=23.3.0=pyhd8ed1ab_0
  - pyperclip=1.8.2=pyhd8ed1ab_2
  - pysocks=1.7.1=pyha2e5f31_6
  - pytest=7.4.3=pyhd8ed1ab_0
  - python=3.11.6=h47c9636_0_cpython
  - python-dateutil=2.8.2=pyhd8ed1ab_0
  - python-fastjsonschema=2.19.0=pyhd8ed1ab_0
  - python-gitlab=4.2.0=pyhd8ed1ab_0
  - python-graphviz=0.20.1=pyh22cad53_0
  - python-json-logger=2.0.7=pyhd8ed1ab_0
  - python-kubernetes=28.1.0=pyhd8ed1ab_0
  - python-slugify=8.0.1=pyhd8ed1ab_2
  - python_abi=3.11=4_cp311
  - pytz=2023.3.post1=pyhd8ed1ab_0
  - pytzdata=2020.1=pyh9f0ad1d_0
  - pyu2f=0.1.5=pyhd8ed1ab_0
  - pywin32-on-windows=0.1.0=pyh1179c8e_3
  - pyyaml=6.0.1=py311heffc1b2_1
  - pyzmq=25.1.2=py311h6727e71_0
  - qtconsole-base=5.5.1=pyha770c72_0
  - qtpy=2.4.1=pyhd8ed1ab_0
  - readchar=4.0.5=pyhd8ed1ab_0
  - readline=8.2=h92ec313_1
  - referencing=0.32.0=pyhd8ed1ab_0
  - regex=2023.10.3=py311heffc1b2_0
  - requests=2.31.0=pyhd8ed1ab_0
  - requests-ftp=0.3.1=py_1
  - requests-oauthlib=1.3.1=pyhd8ed1ab_0
  - requests-toolbelt=1.0.0=pyhd8ed1ab_0
  - rfc3339-validator=0.1.4=pyhd8ed1ab_0
  - rfc3986-validator=0.1.1=pyh9f0ad1d_0
  - rich=13.7.0=pyhd8ed1ab_0
  - rpds-py=0.13.2=py311h94f323b_0
  - rsa=4.9=pyhd8ed1ab_0
  - ruamel.yaml=0.18.5=py311h05b510d_0
  - ruamel.yaml.clib=0.2.7=py311heffc1b2_2
  - send2trash=1.8.2=pyhd1c38e8_0
  - setuptools=68.2.2=pyhd8ed1ab_0
  - shellingham=1.5.4=pyhd8ed1ab_0
  - simplejson=3.19.2=py311h05b510d_0
  - six=1.16.0=pyh6c4a22f_0
  - sniffio=1.3.0=pyhd8ed1ab_0
  - soupsieve=2.5=pyhd8ed1ab_1
  - sqlalchemy=2.0.23=py311h05b510d_0
  - stack_data=0.6.2=pyhd8ed1ab_0
  - starlette=0.27.0=pyhd8ed1ab_0
  - terminado=0.18.0=pyh31c8845_0
  - text-unidecode=1.3=pyhd8ed1ab_1
  - tinycss2=1.2.1=pyhd8ed1ab_0
  - tk=8.6.13=h5083fa2_1
  - toml=0.10.2=pyhd8ed1ab_0
  - tomli=2.0.1=pyhd8ed1ab_0
  - tornado=6.3.3=py311heffc1b2_1
  - tqdm=4.66.1=pyhd8ed1ab_0
  - traitlets=5.14.0=pyhd8ed1ab_0
  - typer=0.9.0=pyhd8ed1ab_0
  - types-python-dateutil=2.8.19.14=pyhd8ed1ab_0
  - typing-extensions=4.8.0=hd8ed1ab_0
  - typing_extensions=4.8.0=pyha770c72_0
  - typing_utils=0.1.0=pyhd8ed1ab_0
  - tzdata=2023c=h71feb2d_0
  - tzlocal=5.2=py311h267d04e_0
  - ujson=5.9.0=py311hbaf5611_0
  - uri-template=1.3.0=pyhd8ed1ab_0
  - urllib3=1.26.18=pyhd8ed1ab_0
  - uvicorn=0.24.0.post1=py311h267d04e_0
  - wcwidth=0.2.12=pyhd8ed1ab_0
  - webcolors=1.13=pyhd8ed1ab_0
  - webencodings=0.5.1=pyhd8ed1ab_2
  - websocket-client=1.7.0=pyhd8ed1ab_0
  - websockets=11.0.3=py311heffc1b2_1
  - wheel=0.42.0=pyhd8ed1ab_0
  - whoosh=2.7.4=py311h267d04e_8
  - widgetsnbextension=4.0.9=pyhd8ed1ab_0
  - xorg-libxau=1.0.11=hb547adb_0
  - xorg-libxdmcp=1.1.3=h27ca646_0
  - xz=5.2.6=h57fd34a_0
  - yaml=0.2.5=h3422bc3_2
  - yarl=1.9.3=py311h05b510d_0
  - zeromq=4.3.5=h965bd2d_0
  - zipp=3.17.0=pyhd8ed1ab_0
  - zlib=1.2.13=h53f4e23_5
  - zstd=1.5.5=h4f39d0f_0
  - pip:
      - datalad-ukbiobank==0.3.5.1
      - reorganizer==0.0.1
      - std2bids==0.0.1
      - stdtobids==0.0.1

Have you had any success using DataLad before?

yes :)

@mslw
Copy link
Contributor

mslw commented Jan 22, 2024

Thanks for reporting this.

I spent a while playing with the code in question. It's not just "metadata", it's any of the available options ({"datasets", "successdatasets-or-none", "paths", "relpaths", "metadata"}), or any callable that returns not-a-get-supporting-object, that produces the described behavior.

However, any of these options can be used without error when the result renderer is disabled, e.g.

ds.status(result_xfm="paths", result_renderer="disabled")

Overview

The result_xfm is a common option, available across the dataset commands. For status in particular it clashes with its custom results renderer.

As you point out, the custom result summary renderer of status expects to deal with objects supporting get -- in practice, DataLad result records (dict). But its execution comes after result_xfm does its transformation.

All the custom result summary renderer does is this: it sums up the annex file sizes and availability info (if requested with --annex), checks whether all reported items have status=clean, and prints messages like "X annexed files, Y/Z present/total size" and/or "nothing to save, working tree clean".

Fix?

On the code side, I can see a few things that could be done, but I'm not sure what is the best. Status could enforce using result_renderer="disabled" when result_xfm is given (but what to do if callable is provided? it might yield "valid" result records). Or the status summary could become silent if it gets something other than dicts with the right keys (possibly slowing it down?).

But what about "metadata"

I am wondering, what was your intended use case for "metadata"?

Using result_xfm="metadata" makes the command replace each result record with the value of its "metadata" field, or None if not available. I am personally not aware of a result record with this field in core DataLad, though.

Could it be that the option is not meaningful any more? There seems to be no tests for it (git grep result_xfm | grep metadata). Blame of datalad/interface/results.py shows that it was introduced in 7faf775 as part of #1630 (v 0.10.0). Could it be something that should have been removed with v0.18.0 which moved metadata handling out of DataLad in favour of the metalad extension?

@psadil
Copy link
Author

psadil commented Jan 22, 2024

@mslw , thanks for following up!

I am wondering, what was your intended use case for "metadata"?

I didn't have one; I discovered the issue while exploring the python api. So, any resolution would work for me (even one that treated the option as something that is not meaningful).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants