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-1248: add is_synapse_id function to the client #950

Merged
merged 11 commits into from Mar 4, 2023

Conversation

vpchung
Copy link
Member

@vpchung vpchung commented Mar 1, 2023

Fixes #948

Aside from the unit tests, I also did tests with real Synapse entities:

>>> # Not real IDs
>>> syn.is_synapse_id("test")
False
>>> syn.is_synapse_id("123")
False
>>> syn.is_synapse_id("syn123")
False
>>> # Real IDs
>>> syn.is_synapse_id("syn36025126")
True
>>> # Also works when user is logged out or lacks access
>>> syn.logout()
>>> syn.is_synapse_id("syn36025126")
True
>>> # Warning will be given if synID is not a string
>>> syn.is_synapse_id([123])
[WARNING] synID must be a string
False

Note: this should probably be merged after #949, since that PR contains fixes to the workflow.

@vpchung vpchung requested a review from a team as a code owner March 1, 2023 01:53
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.

Thanks for the contribution @vpchung ! Some comments.

synapseclient/client.py Outdated Show resolved Hide resolved
synapseclient/client.py Show resolved Hide resolved
tests/unit/synapseclient/unit_test_client.py Outdated Show resolved Hide resolved
@vpchung vpchung requested a review from thomasyu888 March 3, 2023 22:47
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!

@thomasyu888 thomasyu888 merged commit 40eebce into Sage-Bionetworks:develop Mar 4, 2023
@vpchung vpchung deleted the SYNPY-1248 branch March 6, 2023 05:23
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.

[Feature request] Add is_synapse_id to the client
2 participants