Skip to content

dirac-dms-find-lfns with RucioFileCatalog #8329

@maxnoe

Description

@maxnoe

Even with the additions of the metadata related methods to RucioFileCatalogClient, dirac-dms-find-lfns raises an AttributeError forgetMetadataFields.

So this works in python:

fc = RucioFileCatalogClient()
result = fc.findFilesByMetadata({"test-meta": "foo"})

But not on CLI:

[dpps@dpps-pytest dpps]$ dirac-dms-find-lfns Path=/ test-meta=foo
Traceback (most recent call last):
  File "/home/dpps/diracos/bin/dirac-dms-find-lfns", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/dpps/diracos/lib/python3.11/site-packages/DIRAC/Core/Base/Script.py", line 74, in __call__
    return entrypointFunc._func()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dpps/diracos/lib/python3.11/site-packages/DIRAC/DataManagementSystem/scripts/dirac_dms_find_lfns.py", line 41, in main
    result = fc.getMetadataFields()
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/dpps/diracos/lib/python3.11/site-packages/DIRAC/Resources/Catalog/FileCatalog.py", line 158, in __getattr__
    raise AttributeError
AttributeError

However, in rucio, file metadata is not a fixed schema but implemented using json columns. Different files can contain different metadata items and the list of keys and their types is not known ad-hoc.

I think that MetaQuery should optionally allow not validating the passed query keys/types but just parse the query and let the RucioFileCatalog handle the rest.

cc @Barisits @gillardoLapp @cserf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions