Skip to content

[#746] can now give (repl) row result sort function in DataObject constructor #747

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

d-w-moore
Copy link
Collaborator

This affects the overall {create,access,modify}_time, which is simplistically extracted from the first row in the query result-set.

This affects the overall {create,access,modify}_time, which is
simplistically extracted from the first row in the query result-set.
@d-w-moore d-w-moore marked this pull request as draft June 28, 2025 10:00
@d-w-moore d-w-moore changed the title can now give (repl) row result sort function in DataObject constructor [#746] can now give (repl) row result sort function in DataObject constructor Jun 28, 2025
@d-w-moore d-w-moore self-assigned this Jun 28, 2025
@trel
Copy link
Member

trel commented Jun 28, 2025

What is this work part of? Did you need it for something else?

Why do we sort by replica number by default? Should be sorting by 'good' replicas first?

@trel
Copy link
Member

trel commented Jun 28, 2025

oh, #746, it's right there... sorry...

@d-w-moore
Copy link
Collaborator Author

What is this work part of? Did you need it for something else?

Why do we sort by replica number by default? Should be sorting by 'good' replicas first?

(1.) I hint at this above, but basically data_obj.replicas[0].modify_time becomes data_obj.modify_time. So yes, (2.) it would make sense to sort according to good/bad. Or according to modify_time but with reverse sort order.

@@ -46,10 +46,13 @@ def __repr__(self):

class iRODSDataObject:

def __init__(self, manager, parent=None, results=None):
def __init__(self, manager, /, parent=None, results=None, *, results_sort_key = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the / break this interface? In other words, if a client is calling this with manager as a keyword argument, will this cause it to experience errors? I doubt anybody is doing that, but just curious since this will be going into a minor release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that usage would break, but there's no reason we can't include manager as an optional-keyword arg. good eye!

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

Successfully merging this pull request may close these issues.

3 participants