Skip to content

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

Merged
DiamondJoseph merged 2 commits intomainfrom
visit_catch
Mar 18, 2025
Merged

Prevent deserialisation error when fetching data from GDA embedded visit service#956
DiamondJoseph merged 2 commits intomainfrom
visit_catch

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
response.raise_for_status()
json = await response.json()
return DataCollectionIdentifier.model_validate_json(json)
return DataCollectionIdentifier.model_validate(json)
Copy link
Contributor Author

@DiamondJoseph DiamondJoseph Dec 11, 2024

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() converts 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

@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.71%. Comparing base (2d409cd) to head (54a372d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #956   +/-   ##
=======================================
  Coverage   97.71%   97.71%           
=======================================
  Files         166      166           
  Lines        6707     6707           
=======================================
  Hits         6554     6554           
  Misses        153      153           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Approved

@DiamondJoseph DiamondJoseph merged commit 2cf024e into main Mar 18, 2025
19 checks passed
@DiamondJoseph DiamondJoseph deleted the visit_catch branch March 18, 2025 10: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.

3 participants