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

[SYNPY-1349] Detect annotation type #1022

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

BryanFauble
Copy link
Contributor

Problem:
Working with annotations was previously requiring a lot more verbose information. I was forcing a Type to be defined.

Solution:
Using the same logic that is in the current python client convert based off the class types into the appropriate type for the Synapse REST API. This allows us to simply define a list or singular annotation.

Testing:
See the test scripts.

@BryanFauble BryanFauble requested a review from a team as a code owner December 7, 2023 21:49
@pep8speaks
Copy link

Hello @BryanFauble! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 490:89: E501 line too long (91 > 88 characters)
Line 491:89: E501 line too long (92 > 88 characters)
Line 493:89: E501 line too long (89 > 88 characters)

Line 85:89: E501 line too long (90 > 88 characters)

Line 80:89: E501 line too long (90 > 88 characters)

Line 79:89: E501 line too long (90 > 88 characters)

Line 128:89: E501 line too long (90 > 88 characters)

),
"my_single_key_string": "a",
"my_key_string": ["b", "a", "c"],
"my_key_bool": [False, False, False],
Copy link
Member

Choose a reason for hiding this comment

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

I forget, but what does that convert function do when there are mixed types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's returns an object which is than turned into a string:
nested_annos[key] = {"type": "STRING", "value": [str(e) for e in elements]}

Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

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

🔥 LGTM! Thanks for putting this together.

@BryanFauble BryanFauble merged commit d370b46 into SYNPY-1322-OOP-POC Dec 12, 2023
33 checks passed
@BryanFauble BryanFauble deleted the SYNPY-1349-detect-annotation-type branch December 12, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants