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

Allow non-default string types in all metadata calls #444

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

d-w-moore
Copy link
Collaborator

@d-w-moore d-w-moore commented Apr 15, 2023

Here we patch the ModAVUMetadata interface in the Python client to allow both Unicode and bytestring fields everywhere, regardless of which string type is the norm for the running Python interpreter.

Included also:

  • a test to ensure metadata queries, also, can match bytestring and Unicode equally well
  • an extra test that creates one data object with a unicode name, but queries for it using the bytestring equivalent.

@trel
Copy link
Member

trel commented Apr 16, 2023

this PR includes 443 NotLike... but no test? perhaps you want that 1 commit and a test in a different PR?

rest seems good if the tests are passing.

@d-w-moore
Copy link
Collaborator Author

Will do the separate PR, I think. NotLike is used in one of these new tests but it could use its own....

@trel
Copy link
Member

trel commented Apr 16, 2023

Ah. Okay. Yes. Let’s get it in first with its own test.

Then this work… which can also use the NotLike.

@d-w-moore d-w-moore force-pushed the bytestrings_in_AVUs branch 3 times, most recently from 50d92a7 to aa24314 Compare April 18, 2023 11:52
@d-w-moore d-w-moore marked this pull request as draft April 18, 2023 11:56
@d-w-moore
Copy link
Collaborator Author

d-w-moore commented Apr 18, 2023

Should be merged after #445 because one of the tests uses NotLike, so converting to draft for the time being....

@d-w-moore
Copy link
Collaborator Author

Still ready for review, though.

@d-w-moore
Copy link
Collaborator Author

tests pass.

@d-w-moore d-w-moore marked this pull request as ready for review April 18, 2023 23:39
@trel
Copy link
Member

trel commented Apr 19, 2023

nothing jumps out as concerning to me. feels like it's squash time.

@d-w-moore
Copy link
Collaborator Author

Ok, squashed.

@trel
Copy link
Member

trel commented Apr 19, 2023

@alanking, thoughts?

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.

Overall seems fine. I had a couple of thoughts, but they're not really big concerns

irods/test/query_test.py Outdated Show resolved Hide resolved
irods/message/__init__.py Outdated Show resolved Hide resolved
irods/test/meta_test.py Outdated Show resolved Hide resolved
irods/test/meta_test.py Outdated Show resolved Hide resolved
@alanking
Copy link
Contributor

Changes look good. Please resolve open conversations and squash

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.

Hmm... sorry for the back and forth. Just took a look at Codacy and it seems to raise a couple of valid points. And of course we will need to get #445 in before this, as you said before.

irods/test/meta_test.py Outdated Show resolved Hide resolved
irods/test/meta_test.py Outdated Show resolved Hide resolved
@d-w-moore
Copy link
Collaborator Author

Yup, no biggie... will take care of those.

@d-w-moore
Copy link
Collaborator Author

d-w-moore commented Apr 20, 2023

Done with codacy improvements for now. NotLike will reappear once we merge #445 (and rebase this over it); and u"..." is necessary for testing under Python2.

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.

Looks good. #445 is in now. Please squash and #.

This permits use of bytestring text fields when modifying metadata
under Python3, as well as unicode fields under Python2.

We also test that bytestring and unicode types act as they should in
metadata queries.
@alanking alanking merged commit 15287d1 into irods:main Apr 20, 2023
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