Skip to content

IRODS_QUERY_LIMIT now settable/gettable under Python client settings #715

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

d-w-moore
Copy link
Collaborator

No description provided.

Copy link
Contributor

@alanking alanking left a comment

Choose a reason for hiding this comment

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

Are we planning to add a test for this?

@@ -573,6 +573,12 @@ certain environment variables:
- Default Value: `False`
- Environment Variable Override: `PYTHON_IRODSCLIENT_CONFIG__LEGACY_AUTH__PAM__FORCE_USE_OF_DEDICATED_PAM_API`

- Setting: Default number of rows for a Query to retrieve by default.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could use the word "limit" or "maximum" in this description.

Also, I'm a little confused by the word "default" here. This is a configuration value to affect the maximum number of rows that a query can retrieve at a time, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Admittedly, that description seems wrong, so yes let's change it.
I wasn't actually that familiar with the query limit and its function, so I needed to reconsider this.

@@ -36,7 +36,8 @@
"SELECT_COUNT": 6,
}

IRODS_QUERY_LIMIT = os.getenv("IRODS_QUERY_LIMIT", 500)
IRODS_QUERY_LIMIT = 500
Copy link
Contributor

Choose a reason for hiding this comment

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

IRODS_QUERY_LIMIT is used on L200. That means the number is always 500 now. Should we replace that with a call to the irods_query_limit getter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if using the getter would yield any advantage ...?

IRODS_QUERY_LIMIT will be altered through the configuration setting.

Unfortunately, or fortunately, there are no const variables in Python!

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohhh, I see. Okay, let's at least leave a comment saying that the value is changed by that setting

def irods_query_limit(self, int_value):
import irods.query
irods.query.IRODS_QUERY_LIMIT = int(int_value)


connections = ConnectionsProperties()
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious if ConnectionsProperties is the best place for this. Would it be appropriate to introduce a QueryProperties?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe.

Copy link
Contributor

Choose a reason for hiding this comment

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

Having a QueryProperties type makes the most sense to me, but it will ultimately depend on how it fits into the existing query interface.

@trel
Copy link
Member

trel commented Apr 29, 2025

we need an issue number for this work?

edit: found it #712

@d-w-moore
Copy link
Collaborator Author

Are we planning to add a test for this?

Yes

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.

5 participants