Skip to content

Allow measurement.StartTime and t0 of a published waveform to differ#131

Open
dixonjoel wants to merge 4 commits into
mainfrom
users/jdixon/timestamp-t0-consolidation
Open

Allow measurement.StartTime and t0 of a published waveform to differ#131
dixonjoel wants to merge 4 commits into
mainfrom
users/jdixon/timestamp-t0-consolidation

Conversation

@dixonjoel
Copy link
Copy Markdown
Collaborator

What does this Pull Request accomplish?

See https://github.com/ni/datastore-service/issues/517. This makes the Python client match the desired behavior for publishing waveforms with and without a t0 and StartTime. The issue discussion lists the desired behavior.

Why should this Pull Request be merged?

Conform to the desired publish behavior for waveforms.

What testing has been done?

Adding a unit test for the case when neither t0 nor StartTime is specified. Updating unit test not to expect ValueError if the t0 and StartTime do not match.

Joel Dixon added 2 commits May 11, 2026 10:57
…or. Add a test to cover when neither t0 nor StartTime is specified it uses 'now'
Copilot AI review requested due to automatic review settings May 11, 2026 16:16
@dixonjoel dixonjoel requested a review from csjall as a code owner May 11, 2026 16:16
@dixonjoel dixonjoel changed the title Allow measurement.StartTime and t0 of a published Allow measurement.StartTime and t0 of a published waveform to differ May 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Python DataStore client’s publish behavior for waveforms to align with the desired service semantics when timestamp (measurement start time) and waveform t0 are both present, mismatched, or absent.

Changes:

  • Removed client-side validation that raised when a provided timestamp didn’t match waveform t0; the client now always honors the explicitly provided timestamp.
  • Added/updated unit tests to verify (a) mismatched timestamp is used as-requested, and (b) when neither timestamp nor waveform t0 is present, “now” is used.
  • Adjusted pytest configuration to avoid recursing into .venv and to ignore PytestCollectionWarning.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/unit/data/test_publish_measurement.py Updates expectations for mismatched timestamp vs t0 and adds a deterministic test for the “no timestamp and no t0” case.
src/ni/datastore/data/_grpc_conversion.py Removes the mismatch ValueError and makes timestamp selection prefer client timestamp, otherwise waveform t0, otherwise current time.
pyproject.toml Updates pytest settings (including .venv recursion and warning filtering).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml Outdated
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