Skip to content

Conversation

@tchow-zlai
Copy link
Collaborator

@tchow-zlai tchow-zlai commented May 1, 2025

Summary

Checklist

  • Added Unit Tests
  • Covered by existing CI
  • Integration tested
  • Documentation update

Summary by CodeRabbit

  • Tests
    • Improved and expanded tests to verify partition range filtering works consistently between BigQuery native tables and views.
    • Added a new test to ensure partition filtering over specific date ranges returns matching results for both views and tables.
    • Renamed and enhanced an existing test for better clarity and coverage.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 1, 2025

Walkthrough

The test suite for BigQuery integration was updated by renaming an existing test and adding a new one to verify partition handling for both BigQuery native tables and views. The tests use the PartitionRange API to assert that partition sets match over full and truncated date ranges in November 2023, explicitly specifying the partition column "ds". The import for PartitionRange was added to support these changes. No other functional changes were made.

Changes

File(s) Change Summary
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala Renamed test "check views" to "works with views" and updated it to compare partition sets over full month; added new test for partition range filtering over truncated date range; imported PartitionRange.

Possibly related PRs

Suggested reviewers

  • varant-zlai
  • piyush-zlai
  • david-zlai
  • nikhil-zlai

Poem

🍂 November days in partitioned rows,
Views and tables in sync compose.
With PartitionRange to guide the way,
Tests ensure no parts stray.
BigQuery’s secrets now unfold,
In code and tests, the story told.
📊✨

Warning

Review ran into problems

🔥 Problems

GitHub 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 details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 781e1e9 and a6406de.

📒 Files selected for processing (1)
  • cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala
⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: service_commons_tests
  • GitHub Check: service_tests
  • GitHub Check: cloud_gcp_tests
  • GitHub Check: cloud_gcp_tests
  • GitHub Check: cloud_aws_tests
  • GitHub Check: cloud_aws_tests
  • GitHub Check: service_tests
  • GitHub Check: api_tests
  • GitHub Check: online_tests
  • GitHub Check: online_tests
  • GitHub Check: flink_tests
  • GitHub Check: flink_tests
  • GitHub Check: api_tests
  • GitHub Check: aggregator_tests
  • GitHub Check: aggregator_tests
  • GitHub Check: scala_compile_fmt_fix
  • GitHub Check: enforce_triggered_workflows

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (3)

55-66: Renamed and expanded view compatibility test.

Test now verifies both views and tables return identical partitions for November 2023.

Slight grammar issue in test name, should be "works with views" → "work with views".


68-77: Added new test for truncated date range.

Test verifies partition filtering works correctly on smaller date range.

Grammar issue in test name, should be "works with" → "work with".


55-77: Consider extracting common test logic.

Both tests share similar structure and assertions.

+ private def verifyPartitionsMatch(viewName: String, nativeName: String, startDate: String, endDate: String, expectedCount: Int): Unit = {
+   val viewParts = tableUtils.partitions(viewName, partitionRange = Option(PartitionRange(startDate, endDate)(tableUtils.partitionSpec)), partitionColumnName = "ds")
+   assertEquals(expectedCount, viewParts.size)
+   val nativeParts = tableUtils.partitions(nativeName, partitionRange = Option(PartitionRange(startDate, endDate)(tableUtils.partitionSpec)), partitionColumnName = "ds")
+   assertEquals(expectedCount, nativeParts.size)
+   assertEquals(nativeParts.toSet, viewParts.toSet)
+ }
+
  it should "works with views" ignore {
    val viewName = "data.purchases_native_view"
    val nativeName = "data.purchases"
-   val viewParts = tableUtils.partitions(viewName, partitionRange = Option(PartitionRange("2023-11-01", "2023-11-30")(tableUtils.partitionSpec)), partitionColumnName = "ds")
-   assertEquals(30, viewParts.size)
-   val nativeParts = tableUtils.partitions(nativeName, partitionRange = Option(PartitionRange("2023-11-01", "2023-11-30")(tableUtils.partitionSpec)), partitionColumnName = "ds")
-   assertEquals(30, nativeParts.size)
-   assertEquals(nativeParts.toSet, viewParts.toSet)
+   verifyPartitionsMatch(viewName, nativeName, "2023-11-01", "2023-11-30", 30)
  }

  it should "works with a partition range for views and tables" ignore {
    val viewName = "data.purchases_native_view"
    val nativeName = "data.purchases"
-   val viewTruncated = tableUtils.partitions(viewName, partitionRange = Option(PartitionRange("2023-11-28", "2023-11-30")(tableUtils.partitionSpec)), partitionColumnName = "ds")
-   assertEquals(3, viewTruncated.size)
-   val nativeTruncated = tableUtils.partitions(nativeName, partitionRange = Option(PartitionRange("2023-11-28", "2023-11-30")(tableUtils.partitionSpec)), partitionColumnName = "ds")
-   assertEquals(3, nativeTruncated.size)
-   assertEquals(nativeTruncated.toSet, viewTruncated.toSet)
+   verifyPartitionsMatch(viewName, nativeName, "2023-11-28", "2023-11-30", 3)
  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 123f1bc and c8db59d.

📒 Files selected for processing (1)
  • cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (2)
spark/src/main/scala/ai/chronon/spark/catalog/TableUtils.scala (3)
  • TableUtils (43-656)
  • TableUtils (658-660)
  • partitions (183-208)
cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryNative.scala (1)
  • partitions (128-204)
⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: service_tests
  • GitHub Check: service_tests
  • GitHub Check: service_commons_tests
  • GitHub Check: online_tests
  • GitHub Check: cloud_gcp_tests
  • GitHub Check: cloud_gcp_tests
  • GitHub Check: cloud_aws_tests
  • GitHub Check: cloud_aws_tests
  • GitHub Check: online_tests
  • GitHub Check: api_tests
  • GitHub Check: flink_tests
  • GitHub Check: aggregator_tests
  • GitHub Check: api_tests
  • GitHub Check: scala_compile_fmt_fix
  • GitHub Check: flink_tests
  • GitHub Check: aggregator_tests
  • GitHub Check: enforce_triggered_workflows
🔇 Additional comments (3)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (3)

3-3: Added PartitionRange import to support partition filtering in tests.

New import enables date-based partition range specification in test cases.


40-48: Activated BigQuery Iceberg catalog configuration.

Uncommented configuration enables BigQuery Iceberg catalog integration for tests.


55-77:

✅ Verification successful

Both tests are marked with ignore.

Tests won't run in automated test suites but follow existing pattern for integration tests.


🏁 Script executed:

#!/bin/bash
# Check if other BigQuery tests are also ignored and if there's documentation
grep -n "ignore.*BigQuery" cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala
grep -n "TODO.*BigQuery" cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala

Length of output: 225


Confirm intentional ignores on BigQuery view tests
Both tests in BigQueryCatalogTest.scala are marked ignore, matching our existing integration-test pattern. No changes needed.

@tchow-zlai tchow-zlai merged commit 1af1abd into main May 2, 2025
20 checks passed
@tchow-zlai tchow-zlai deleted the tchow/add-tests branch May 2, 2025 17:51
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary

## 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

- **Tests**
- Improved and expanded tests to verify partition range filtering works
consistently between BigQuery native tables and views.
- Added a new test to ensure partition filtering over specific date
ranges returns matching results for both views and tables.
- Renamed and enhanced an existing test for better clarity and coverage.
<!-- 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: thomaschow <[email protected]>
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary

## 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

- **Tests**
- Improved and expanded tests to verify partition range filtering works
consistently between BigQuery native tables and views.
- Added a new test to ensure partition filtering over specific date
ranges returns matching results for both views and tables.
- Renamed and enhanced an existing test for better clarity and coverage.
<!-- 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: thomaschow <[email protected]>
chewy-zlai pushed a commit that referenced this pull request May 16, 2025
## Summary

## 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

- **Tests**
- Improved and expanded tests to verify partition range filtering works
consistently between BigQuery native tables and views.
- Added a new test to ensure partition filtering over specific date
ranges returns matching results for both views and tables.
- Renamed and enhanced an existing test for better clarity and coverage.
<!-- 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: thomaschow <[email protected]>
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.

3 participants