Skip to content

Conversation

@tchow-zlai
Copy link
Collaborator

@tchow-zlai tchow-zlai commented Dec 25, 2024

Summary

Checklist

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

Summary by CodeRabbit

  • New Features

    • Added a new test class to validate GCS format partitioning functionality.
  • Refactor

    • Updated package structure for test files.
    • Removed specific imports in test files.
  • Chores

    • Added an import for a BigQuery table in the format handling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 25, 2024

Walkthrough

This pull request involves package restructuring and minor code modifications across several GCP integration test files. The changes primarily focus on adjusting package declarations, removing specific imports, and introducing a new test class for GCS format testing. The modifications suggest a reorganization of the project's package structure and test coverage for Google Cloud Storage format handling.

Changes

File Change Summary
cloud_gcp/src/main/scala/.../BigQueryFormat.scala Added import for com.google.cloud.bigquery.Table; separated imports for col and to_date into distinct lines.
cloud_gcp/src/test/scala/.../BigQueryCatalogTest.scala Moved package from .test to main package; removed imports for BQuery and GcpFormatProvider.
cloud_gcp/src/test/scala/.../DataprocSubmitterTest.scala Moved package from .test to main package; removed imports for DataprocSubmitter and SubmitterConf.
cloud_gcp/src/test/scala/.../GCSFormatTest.scala New test class added for GCS format partition testing.

Suggested reviewers

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

Possibly related PRs

Poem

🌥️ In clouds of code, we dance and play,
Imports shift, packages sway,
GCS tests bloom like spring's first ray,
Refactoring's gentle, melodic way!
🚀 Cloud magic unfurls today!


📜 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 80a01b3 and 3c774fa.

📒 Files selected for processing (1)
  • cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala

🪧 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.

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 docstrings to generate docstrings for this PR. (Beta)
  • @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.

@tchow-zlai tchow-zlai force-pushed the tchow/bq-support-9 branch 2 times, most recently from 8963d86 to 98b6e58 Compare December 28, 2024 18:26
@tchow-zlai tchow-zlai force-pushed the tchow/bq-support-10 branch 2 times, most recently from 0f85bbb to 3502bab Compare December 28, 2024 18:29
@tchow-zlai tchow-zlai force-pushed the tchow/bq-support-9 branch 2 times, most recently from c30c4ab to f6573cf Compare December 28, 2024 18:31
@tchow-zlai tchow-zlai force-pushed the tchow/bq-support-10 branch 2 times, most recently from dd86306 to 3b7bb43 Compare December 28, 2024 18:39
@tchow-zlai tchow-zlai force-pushed the tchow/bq-support-10 branch 2 times, most recently from 5da0b1c to 454d9a8 Compare December 28, 2024 20:58
@tchow-zlai tchow-zlai force-pushed the tchow/bq-support-10 branch 2 times, most recently from 616e47c to 2fe5f01 Compare December 29, 2024 07:28
Copy link
Contributor

@david-zlai david-zlai left a comment

Choose a reason for hiding this comment

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

awesomeeeee

Comment on lines +18 to +21
lazy val spark: SparkSession = SparkSessionBuilder.build(
"BigQuerySparkTest",
local = true
)
Copy link
Contributor

Choose a reason for hiding this comment

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

wondered if we should put this in a setup and then add a teardown to stop the spark session?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that would be a good way to do it, but I think it may not work well with how things are set up in Chronon - we actually use a singleton spark session everywhere for unit tests. If the tests run in parallel, shutting down the spark session here may cause other in flight unit tests to crash unexpectedly.

Base automatically changed from tchow/bq-support-9 to main January 4, 2025 00:51
tchow-zlai and others added 4 commits January 3, 2025 16:53
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>

Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>

Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>

Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>
-e 
Co-authored-by: Thomas Chow <[email protected]>

Co-authored-by: Thomas Chow <[email protected]>
@tchow-zlai tchow-zlai force-pushed the tchow/bq-support-10 branch from 37e326a to 9b39ab2 Compare January 4, 2025 00:55
tchow-zlai and others added 2 commits January 3, 2025 16:55
Co-authored-by: Thomas Chow <[email protected]>
Co-authored-by: Thomas Chow <[email protected]>
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 (1)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/GCSFormatTest.scala (1)

3-3: Prefer ScalaTest assertions
You're mixing JUnit assertEquals with ScalaTest AnyFunSuite. Using ScalaTest's built-ins (e.g., assert) yields consistency.

📜 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 688db65 and 80a01b3.

📒 Files selected for processing (4)
  • cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala (1 hunks)
  • cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (1 hunks)
  • cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/DataprocSubmitterTest.scala (1 hunks)
  • cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/GCSFormatTest.scala (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala
  • cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/DataprocSubmitterTest.scala
🔇 Additional comments (5)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (1)

1-1: Verify references. The package rename might break them if they’re no longer in scope.

cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/GCSFormatTest.scala (4)

16-21: Revisit shared Spark session
Using a shared singleton spark session can cause concurrency issues in parallel test runs (previously discussed).


23-41: Comprehensive partition test
This effectively tests partition logic. Good coverage.


43-61: Empty partition test
Nice check for absence of partitions.


63-91: Date partition test
Good approach. Watch out for time zone differences.

Co-authored-by: Thomas Chow <[email protected]>
@tchow-zlai tchow-zlai merged commit 3aa7369 into main Jan 4, 2025
4 checks passed
@tchow-zlai tchow-zlai deleted the tchow/bq-support-10 branch January 4, 2025 05:09
@coderabbitai coderabbitai bot mentioned this pull request Jan 16, 2025
4 tasks
kumar-zlai pushed a commit that referenced this pull request Apr 25, 2025
## Summary

- Adding unit tests for #147 
- https://app.asana.com/0/1208949807589885/1208960391734329/f

## Checklist
- [x] 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

- **New Features**
- Added a new test class to validate GCS format partitioning
functionality.

- **Refactor**
	- Updated package structure for test files.
	- Removed specific imports in test files.

- **Chores**
	- Added an import for a BigQuery table in the format handling.
<!-- 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]>
kumar-zlai pushed a commit that referenced this pull request Apr 29, 2025
## Summary

- Adding unit tests for #147 
- https://app.asana.com/0/1208949807589885/1208960391734329/f

## Checklist
- [x] 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

- **New Features**
- Added a new test class to validate GCS format partitioning
functionality.

- **Refactor**
	- Updated package structure for test files.
	- Removed specific imports in test files.

- **Chores**
	- Added an import for a BigQuery table in the format handling.
<!-- 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]>
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary

- Adding unit tests for #147 
- https://app.asana.com/0/1208949807589885/1208960391734329/f

## Checklist
- [x] 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

- **New Features**
- Added a new test class to validate GCS format partitioning
functionality.

- **Refactor**
	- Updated package structure for test files.
	- Removed specific imports in test files.

- **Chores**
	- Added an import for a BigQuery table in the format handling.
<!-- 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]>
chewy-zlai pushed a commit that referenced this pull request May 16, 2025
## Summary

- Adding unit tests for #147 
- https://app.asana.com/0/1208949807589885/1208960391734329/f

## Cheour clientslist
- [x] 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

- **New Features**
- Added a new test class to validate GCS format partitioning
functionality.

- **Refactor**
	- Updated paour clientsage structure for test files.
	- Removed specific imports in test files.

- **Chores**
	- Added an import for a BigQuery table in the format handling.
<!-- 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]>
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.

5 participants