-
Notifications
You must be signed in to change notification settings - Fork 9
fix: bootstrap unit tests should be deterministic #487
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
Conversation
WalkthroughThe changes refactor how test files load tables by replacing direct calls to Spark’s table access with calls to a utility method ( Changes
Possibly related PRs
Suggested reviewers
Poem
Warning Review ran into problems🔥 ProblemsGitHub Actions and Pipeline Checks: Resource not accessible by integration - https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository. Please grant the required permissions to the CodeRabbit GitHub App under the organization or repository settings. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (14)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Co-authored-by: Thomas Chow <[email protected]>
7999460 to
48560fb
Compare
Co-authored-by: Thomas Chow <[email protected]>
nikhil-zlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great find!
## Summary
- In certain tests we will generate some dummy data with random values.
We proceed to use this data to do correctness checks. However, since
dataframes are lazily evaluated, whenever we reference the value of the
dataframe, the random generation kicks in. Thus, we sometimes get
incorrect unit test results based on the data that gets generated at the
time of referencing the dataframe. The fix is to first save the
dataframe to a table, and load it back immediately to preserve the
values that were generated the first time.
## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Refactor**
- Standardized the approach to loading table data in test cases for
improved consistency and maintainability.
- Updated variable names to enhance clarity regarding the data being
handled.
- **Tests**
- Improved test logic with clearer variable naming and a refined process
to ensure tests reflect the most recent data state after saving.
- Minor formatting adjustment in the test case for better readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->
---------
Co-authored-by: Thomas Chow <[email protected]>
## Summary
- In certain tests we will generate some dummy data with random values.
We proceed to use this data to do correctness checks. However, since
dataframes are lazily evaluated, whenever we reference the value of the
dataframe, the random generation kicks in. Thus, we sometimes get
incorrect unit test results based on the data that gets generated at the
time of referencing the dataframe. The fix is to first save the
dataframe to a table, and load it back immediately to preserve the
values that were generated the first time.
## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Refactor**
- Standardized the approach to loading table data in test cases for
improved consistency and maintainability.
- Updated variable names to enhance clarity regarding the data being
handled.
- **Tests**
- Improved test logic with clearer variable naming and a refined process
to ensure tests reflect the most recent data state after saving.
- Minor formatting adjustment in the test case for better readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->
---------
Co-authored-by: Thomas Chow <[email protected]>
## Summary
- In certain tests we will generate some dummy data with random values.
We proceed to use this data to do correctness checks. However, since
dataframes are lazily evaluated, whenever we reference the value of the
dataframe, the random generation kicks in. Thus, we sometimes get
incorrect unit test results based on the data that gets generated at the
time of referencing the dataframe. The fix is to first save the
dataframe to a table, and load it back immediately to preserve the
values that were generated the first time.
## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Refactor**
- Standardized the approach to loading table data in test cases for
improved consistency and maintainability.
- Updated variable names to enhance clarity regarding the data being
handled.
- **Tests**
- Improved test logic with clearer variable naming and a refined process
to ensure tests reflect the most recent data state after saving.
- Minor formatting adjustment in the test case for better readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->
---------
Co-authored-by: Thomas Chow <[email protected]>
## Summary
- In certain tests we will generate some dummy data with random values.
We proceed to use this data to do correctness checks. However, since
dataframes are lazily evaluated, whenever we reference the value of the
dataframe, the random generation kicks in. Thus, we sometimes get
incorrect unit test results based on the data that gets generated at the
time of referencing the dataframe. The fix is to first save the
dataframe to a table, and load it back immediately to preserve the
values that were generated the first time.
## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Refactor**
- Standardized the approach to loading table data in test cases for
improved consistency and maintainability.
- Updated variable names to enhance clarity regarding the data being
handled.
- **Tests**
- Improved test logic with clearer variable naming and a refined process
to ensure tests reflect the most recent data state after saving.
- Minor formatting adjustment in the test case for better readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->
---------
Co-authored-by: Thomas Chow <[email protected]>
## Summary
- In certain tests we will generate some dummy data with random values.
We proceed to use this data to do correctness cheour clientss. However, since
dataframes are lazily evaluated, whenever we reference the value of the
dataframe, the random generation kiour clientss in. Thus, we sometimes get
incorrect unit test results based on the data that gets generated at the
time of referencing the dataframe. The fix is to first save the
dataframe to a table, and load it baour clients immediately to preserve the
values that were generated the first time.
## Cheour clientslist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Refactor**
- Standardized the approach to loading table data in test cases for
improved consistency and maintainability.
- Updated variable names to enhance clarity regarding the data being
handled.
- **Tests**
- Improved test logic with clearer variable naming and a refined process
to ensure tests reflect the most recent data state after saving.
- Minor formatting adjustment in the test case for better readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to traour clients
the status of staour clientss when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->
---------
Co-authored-by: Thomas Chow <[email protected]>
Summary
Checklist
Summary by CodeRabbit
Refactor
Tests