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

Allow sampling from snapshots and of snapshots #11311

Merged

Conversation

QMalcolm
Copy link
Contributor

Resolves #11301

Problem

  • ref(my_snapshot) should be sample-able from a model
  • ref(my_model) should be sample-able from a snapshot

Solution

  • Enable sampling refs and sources in snapshots
  • Test the existing ability to sample ref('a_snapshot') from models

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

Of note the parameterization of `test_resolve_event_time_filter` in
tests/unit/context/test_providers.py is getting large and cumbersome.
It may be time soon to split it into a few distinct tests to facilitate
the necessity of fewer parametrized arguments for a given test.
Previously we were doing `isintance(a, class1) or (isinstance(a, class2)`
but this can be simplified to `isintance(a, (class1, class2))`. Woops.
@QMalcolm QMalcolm requested a review from a team as a code owner February 14, 2025 21:34
@cla-bot cla-bot bot added the cla:yes label Feb 14, 2025
Notably we didn't have to add `insinstance(self.target, SnapshotConfig)` to the
checks in `resolve_event_time_filter` because `SnapshotConfig` is a subclass
of `NodeConfig`.
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.91%. Comparing base (aa30669) to head (acbd380).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11311   +/-   ##
=======================================
  Coverage   88.91%   88.91%           
=======================================
  Files         189      189           
  Lines       24170    24170           
=======================================
  Hits        21490    21490           
  Misses       2680     2680           
Flag Coverage Δ
integration 86.17% <ø> (ø)
unit 62.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.53% <ø> (ø)
Integration Tests 86.17% <ø> (ø)

@QMalcolm QMalcolm force-pushed the qmalcolm--11301-sampling-from-snapshots-and-of-snapshots branch from 21a9b1a to acbd380 Compare February 14, 2025 21:36
@QMalcolm QMalcolm merged commit aa89740 into main Feb 14, 2025
63 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--11301-sampling-from-snapshots-and-of-snapshots branch February 14, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ability to sample snapshots
2 participants