DIRACGrid / DIRACGrid/DIRAC

dirac-dms-find-lfns with RucioFileCatalog

Open
#8,329 1 comment 0 reactions 1 assignee Claimed by @arrabito View on GitHub
Dominant language
Python
Stars
126
Forks
191
Avg merge
1d 13h
Merged PRs (30d)
33

Description

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

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
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.