consistency strong #37
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Did some manual local test, 3 runs:
without header
total create_entity call time: 41.047, 46.856, 86.077
_wait_for_entity_ready call inside create_entity time: 3.432, 10.084, 40.917 (total attempts are 2, 3, 5, respectively)
with header
total create_entity call time: 27.162, 31.084, 32.804
_wait_for_entity_ready call inside create_entity time: 0.978, 1.318, 2.118 (all 1 attempt)
Copilot summary:
This pull request updates the entity retrieval logic in the
src/dataverse_sdk/odata.pymodule to improve data consistency when waiting for an entity to be ready. The main change is the introduction of strong consistency headers when polling for entity readiness.Improvements to entity polling consistency:
_get_entity_by_schemamethod now accepts an optionalheadersparameter, allowing custom HTTP headers to be passed to the request._wait_for_entity_readymethod, requests to retrieve the entity now include a"Consistency": "Strong"header to ensure the latest data is fetched during polling.