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

Prevent deserialisation error when fetching data from GDA embedded visit service #956

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DiamondJoseph
Copy link
Contributor

During beamline testing on i22 December 10th, it was found that the current visit service impl uses the wrong method to convert the return value of the GDA numTracker

Instructions to reviewer on how to test:

  1. Run a scan that uses GDA as the numTracker service
  2. Confirm that the data_session can be deserialised

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@DiamondJoseph DiamondJoseph requested a review from a team as a code owner December 11, 2024 12:38
@@ -78,7 +78,7 @@ async def _identifier_from_response(
):
response.raise_for_status()
json = await response.json()
return DataCollectionIdentifier.model_validate_json(json)
return DataCollectionIdentifier.model_validate(json)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

model_validate_json is for turning a JSON string into the object. model_validate is for turning a Python object. response.json() seems to convert the JSON string returned by the numTracker service into a dict.

@DiamondJoseph DiamondJoseph changed the title Prevent deserialisaiton error when fetching data from GDA embedded visit service Prevent deserialisation error when fetching data from GDA embedded visit service Dec 11, 2024
@rtuck99
Copy link
Contributor

rtuck99 commented Dec 13, 2024

Please can you fix the tests

Copy link
Contributor

@rtuck99 rtuck99 left a comment

Choose a reason for hiding this comment

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

See above

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.

2 participants