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
Patch 6348 list rules keyerror #6377
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome! I have impression that you misunderstood the issue. No changes are expected in the Rucio client. Instead, you should modify the core to include the missing information.
Lines 881 to 901 in 7bbdf63
@stream_session | |
def list_associated_rules_for_file(scope, name, *, session: "Session"): | |
""" | |
List replication rules a file is affected from. | |
:param scope: Scope of the file. | |
:param name: Name of the file. | |
:param session: The database session in use. | |
:raises: RucioException | |
""" | |
rucio.core.did.get_did(scope=scope, name=name, session=session) # Check if the did acually exists | |
query = session.query(models.ReplicationRule).\ | |
with_hint(models.ReplicaLock, "INDEX(LOCKS LOCKS_PK)", 'oracle').\ | |
join(models.ReplicaLock, models.ReplicationRule.id == models.ReplicaLock.rule_id).\ | |
filter(models.ReplicaLock.scope == scope, models.ReplicaLock.name == name).distinct() | |
try: | |
for rule in query.yield_per(5): | |
yield rule.to_dict() | |
except StatementError as exc: | |
raise RucioException('Badly formatted input (IDs?)') from exc |
c158b34
to
6f66c1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6f66c1d
to
bdecfac
Compare
We’ve had to give priority to the other PR. Now that it is merged, kindly amend your work over the latest master branch. Thank you in advance. |
f7088ef
to
2dd8168
Compare
2dd8168
to
d44b665
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marvelous. Many thanks and sorry about the long delay. @bari12 I propose to make a freeze exception.
Addressing issue #6348 and adding a test for it.
I missed the commit message format in the contrib guidelines first time around - so we have some duplicate commits from the rebase.