Skip to content

Conversation

@jaymedina
Copy link
Contributor

@jaymedina jaymedina commented Sep 30, 2025

See #1250

All tests passing:

(synapseclient) bash-3.2$ pytest tests/integration/synapseclient/models/synchronous/*submission*.py 
======================================================================= test session starts ========================================================================
platform darwin -- Python 3.9.18, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/jmedina/Documents/forks/synapsePythonClient
configfile: pytest.ini
plugins: asyncio-0.24.0, socket-0.7.0, anyio-4.6.0, mock-3.14.0
asyncio: mode=auto, default_loop_scope=session
collected 67 items                                                                                                                                                 

tests/integration/synapseclient/models/synchronous/test_submission.py .....................                                                                  [ 31%]
tests/integration/synapseclient/models/synchronous/test_submission_bundle.py ...............                                                                 [ 53%]
tests/integration/synapseclient/models/synchronous/test_submission_status.py .......................                                                         [ 88%]
tests/integration/synapseclient/models/synchronous/test_submissionview.py ........                                                                           [100%]
======================================================================= test session starts ========================================================================
platform darwin -- Python 3.9.18, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/jmedina/Documents/forks/synapsePythonClient
configfile: pytest.ini
plugins: asyncio-0.24.0, socket-0.7.0, anyio-4.6.0, mock-3.14.0
asyncio: mode=auto, default_loop_scope=session
collected 68 items                                                                                                                                                 

tests/integration/synapseclient/models/async/test_submission_async.py ......................                                                                 [ 32%]
tests/integration/synapseclient/models/async/test_submission_bundle_async.py ...............                                                                 [ 54%]
tests/integration/synapseclient/models/async/test_submission_status_async.py .......................                                                         [ 88%]
======================================================================= test session starts ========================================================================
platform darwin -- Python 3.9.18, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/jmedina/Documents/forks/synapsePythonClient
configfile: pytest.ini
plugins: asyncio-0.24.0, socket-0.7.0, anyio-4.6.0, mock-3.14.0
asyncio: mode=auto, default_loop_scope=session
collected 53 items                                                                                                                                                 

tests/unit/synapseclient/models/async/unit_test_submission_async.py ................                                                                         [ 30%]
tests/unit/synapseclient/models/async/unit_test_submission_bundle_async.py ..............                                                                    [ 56%]
tests/unit/synapseclient/models/async/unit_test_submission_status_async.py .......................                                                           [100%]

======================================================================== 53 passed in 1.61s ========================================================================
======================================================================= test session starts ========================================================================
platform darwin -- Python 3.9.18, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/jmedina/Documents/forks/synapsePythonClient
configfile: pytest.ini
plugins: asyncio-0.24.0, socket-0.7.0, anyio-4.6.0, mock-3.14.0
asyncio: mode=auto, default_loop_scope=session
collected 67 items                                                                                                                                                 

tests/unit/synapseclient/models/synchronous/unit_test_submission.py .............................                                                            [ 43%]
tests/unit/synapseclient/models/synchronous/unit_test_submission_bundle.py ...............                                                                   [ 65%]
tests/unit/synapseclient/models/synchronous/unit_test_submission_status.py .......................                                                           [100%]

@jaymedina jaymedina force-pushed the synpy-1590-submission-model-main branch from 8b50d06 to a061fb4 Compare November 5, 2025 14:46
@jaymedina jaymedina force-pushed the synpy-1590-submission-model-functionality branch from 62ce5fb to f0d7ecc Compare November 5, 2025 15:04
@jaymedina jaymedina marked this pull request as ready for review November 21, 2025 19:29
@jaymedina jaymedina requested a review from a team as a code owner November 21, 2025 19:29
@jaymedina jaymedina force-pushed the synpy-1590-submission-model-main branch from a061fb4 to c748132 Compare December 1, 2025 16:33
return entity_info
except Exception as e:
raise ValueError(
f"Unable to fetch entity information for {self.entity_id}: {e}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason not to do
raise ValueError(msg) from e ?

docker_tag_response = await client.rest_get_async(
f"/entity/{self.entity_id}/dockerTag"
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be an api function?

request_body["dockerRepositoryName"] = self.docker_repository_name
if self.docker_digest is not None:
request_body["dockerDigest"] = self.docker_digest

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have a list of optional fields and then use a for loop to iterate over them, and them to the request body if they are not none?

Raises:
ValueError: If any required attributes are missing.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be an example for this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I don't think so, as this method won't be surfaced in the documentation. I could turn it into a hidden function instead?

Returns:
A dictionary containing the request body for updating a submission status.
Copy link
Contributor

Choose a reason for hiding this comment

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

Example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

request_body["canCancel"] = self.can_cancel
if self.cancel_requested is not None:
request_body["cancelRequested"] = self.cancel_requested

Copy link
Contributor

Choose a reason for hiding this comment

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

Same suggestion as Submission about turning this into a for loop.

Comment on lines +489 to +492
except Exception as e:
raise ValueError(
f"Unable to fetch entity information for {self.entity_id}: {e}"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be catching every possible exception here and assuming they're all the same cause, or would it be useful to break the catching up into synapse errors and other possible kinds? Also would a LookupError make more sense here than a ValueError?

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, we could do raise ValueError(msg) from e here. Then the user would still get a ValueError but would also see the exception that was caught as well.


# THEN the batch update should succeed
assert response is not None
assert "batchToken" in response or response == {} # Response format may vary
Copy link
Contributor

Choose a reason for hiding this comment

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

what causes the response formats to vary? should those be different parametrizations for this test?

Comment on lines +102 to +104
assert (
submission_status.status is not None
) # Should have some status (e.g., "RECEIVED")
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as similar one above

@andrewelamb
Copy link
Contributor

Looking good so far! I didn't see any deprecations, will you be doing that as part of this PR?

@jaymedina jaymedina force-pushed the synpy-1590-submission-model-main branch from c748132 to 31d9583 Compare December 2, 2025 19:47
SageGJ and others added 5 commits December 3, 2025 16:37
* always log warning

* check assert called with

* patch object on class instance

* Revert "always log warning"

This reverts commit ae63c81.

* update patch target

* re-add erroneously removed line
@jaymedina
Copy link
Contributor Author

Looking good so far! I didn't see any deprecations, will you be doing that as part of this PR?

@andrewelamb that's been done in PR #1252 which I'll address after addressing all the threads here.

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.

6 participants