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

[8.0] Implementation of metadata methods into RucioFileCatalogClient #7383

Open
wants to merge 1 commit into
base: rel-v8r0
Choose a base branch
from

Conversation

cserf
Copy link

@cserf cserf commented Jan 3, 2024

Closes #7382

BEGINRELEASENOTES

*Resources
NEW : Introduce a first implementation of metadata methods into RucioFileCatalogClient

ENDRELEASENOTES

@DIRACGridBot DIRACGridBot added the alsoTargeting:integration Cherry pick this PR to integration after merge label Jan 3, 2024
Copy link
Contributor

@martynia martynia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a rather lightweight review since I don't have a working multi-VO Rucio server to see what the client actually does. Most of work is delegated to the server so it would be beyond the client review. I think one would need some basic unit tests of the client to follow the logic. This would be especially useful for set and delete methods where it is unclear what they are supposed to return.

def getFileUserMetadata(self, path):
"""Get the meta data attached to a file, but also to
all its parents
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe method arguments for all methods (and their return objects)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

self.client.set_dids_metadata_bulk(dids=dids, recursive=False)
except Exception as err:
return S_ERROR(str(err))
return S_OK(resDict)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is resDict ever updated?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Will change it. Since we use a bulk method server side, the metadata will be either all registered or all failed

if failedMeta:
metaExample = list(failedMeta)[0]
result = S_ERROR(f"Failed to remove {len(failedMeta)} metadata, e.g. {failedMeta[metaExample]}")
result["FailedMetadata"] = failedMeta
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the key be "Failed" ?
result is never used. This is true for resDict as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a mistake. It should be

return S_ERROR(f"Failed to remove {len(failedMeta)} metadata, e.g. {failedMeta[metaExample]}")

@maxnoe
Copy link
Contributor

maxnoe commented Sep 17, 2024

Any update here? Anything we could do to help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alsoTargeting:integration Cherry pick this PR to integration after merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants