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 for running sample mode with build command #11307

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

QMalcolm
Copy link
Contributor

Resolves #11298

Problem

Sample mode could only be run with run command, we want to also use it with build command

Solution

Allow for specification of --sample=SAMPLE_SPEC on build command

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.

@QMalcolm QMalcolm requested a review from a team as a code owner February 14, 2025 00:31
@cla-bot cla-bot bot added the cla:yes label Feb 14, 2025
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.89%. Comparing base (7041e58) to head (365ab8b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11307      +/-   ##
==========================================
- Coverage   88.95%   88.89%   -0.07%     
==========================================
  Files         189      189              
  Lines       24169    24170       +1     
==========================================
- Hits        21500    21486      -14     
- Misses       2669     2684      +15     
Flag Coverage Δ
integration 86.15% <100.00%> (-0.13%) ⬇️
unit 62.53% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
Unit Tests 62.53% <100.00%> (+<0.01%) ⬆️
Integration Tests 86.15% <100.00%> (-0.13%) ⬇️

Copy link
Member

@aranke aranke left a comment

Choose a reason for hiding this comment

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

Can you add a test for a node that cannot be sampled? E.g. exposures

@QMalcolm
Copy link
Contributor Author

QMalcolm commented Feb 14, 2025

Can you add a test for a node that cannot be sampled? E.g. exposures

@aranke Hmmm I'm not sure I agree.

In the specific context of exposures, there isn't a way I'm aware of to test this. Exposures are leaf nodes and thus can't be ref'd, which doesn't seem in the purview of this work. There is an argument of, we should test whether the depends_on ref's and source's should be tested for exposures. However, exposures are no-op's, and so I'm not aware of a way to test them.

There is an argument for the general "test for a node that cannot be sampled". However, I don't think it is actually time for that yet. Sample mode is still in alpha/beta, and using it is gated behind an environment variable. Our general goal for GA is that for anything that render's ref() and source() into select SQL statements, those ref/source statements should be sampleable. As we add specific support for different node types being ref'd, we add positive tests to assert that they are supported. If we end up specifically not supporting sampling of refs of certain node types, we should add tests for that. We have not identified anything that fits that yet though. If we do identify anything like that, it'll likely be tied to #11228, and thus it feels out of scope of this PR.

@QMalcolm QMalcolm requested a review from aranke February 14, 2025 17:06
Copy link
Member

@aranke aranke left a comment

Choose a reason for hiding this comment

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

Clarified with @QMalcolm offline, this only affects nodes that can be called via ref or source.

@QMalcolm QMalcolm merged commit aa30669 into main Feb 14, 2025
72 of 73 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--11298-enable-sample-mode-for-build-command branch February 14, 2025 18:40
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.

allow for sample mode during build command
3 participants