Skip to content

Conversation

@varant-zlai
Copy link
Collaborator

@varant-zlai varant-zlai commented Jun 26, 2025

Summary

Modifying one of the fetcher tests to user short names

Checklist

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

Summary by CodeRabbit

  • Refactor
    • Improved selection of relevant columns in test data processing for clarity and precision.
    • Simplified and clarified join configuration setup in test utilities, including more explicit naming and configuration options.
    • Enhanced data fetching logic by refining prefix assignment for join part requests.
    • Updated prefix usage in response parsing and tests to remove underscores for consistency.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 26, 2025

Walkthrough

The changes update test utility logic for join configuration construction and event DataFrame column selection. The modifications switch from dropping columns by name pattern to explicit column selection, refactor join configuration building to a fluent style with clearer naming and explicit options, and adjust prefix usage in a fetcher request and related tests.

Changes

File(s) Change Summary
spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherTest.scala Replaced drop-by-name with explicit column selection for test DataFrame columns.
spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherTestUtil.scala Refactored join config builder to fluent style; simplified derivation names; set useLongNames false.
online/src/main/scala/ai/chronon/online/fetcher/JoinPartFetcher.scala Changed prefix from fullPrefix to columnPrefix in PrefixedRequest; removed underscores in keys.
online/src/test/scala/ai/chronon/online/test/FetcherBaseTest.scala Updated prefix argument in parseGroupByResponse calls from "prefix" to "prefix_".
spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherFailureTest.scala Changed exception key construction to use columnPrefix without underscore in test assertions.

Suggested reviewers

  • nikhil-zlai
  • piyush-zlai

Poem

In tests where joins and columns play,
The builders now have clearer say.
No more drops by name’s disguise—
Just pick the columns you truly prize!
With prefixes trimmed and tidy code,
The fetchers march a smoother road.
✨🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91c13d2 and 162a567.

📒 Files selected for processing (1)
  • spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherFailureTest.scala (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherFailureTest.scala (8)
Learnt from: chewy-zlai
PR: zipline-ai/chronon#50
File: spark/src/test/scala/ai/chronon/spark/test/MockKVStore.scala:19-28
Timestamp: 2024-10-31T18:29:45.027Z
Learning: In `MockKVStore` located at `spark/src/test/scala/ai/chronon/spark/test/MockKVStore.scala`, the `multiPut` method is intended to be a simple implementation without dataset existence validation, duplicate validation logic elimination, or actual storage of key-value pairs for verification.
Learnt from: piyush-zlai
PR: zipline-ai/chronon#33
File: cloud_aws/src/test/scala/ai/chronon/integrations/aws/DynamoDBKVStoreTest.scala:175-175
Timestamp: 2024-10-07T15:09:51.567Z
Learning: Hardcoding future timestamps in tests within `DynamoDBKVStoreTest.scala` is acceptable when data is generated and queried within the same time range, ensuring the tests remain valid over time.
Learnt from: piyush-zlai
PR: zipline-ai/chronon#53
File: hub/app/controllers/TimeSeriesController.scala:224-224
Timestamp: 2024-10-29T15:21:58.102Z
Learning: In the mocked data implementation in `hub/app/controllers/TimeSeriesController.scala`, potential `NumberFormatException` exceptions due to parsing errors (e.g., when using `val featureId = name.split("_").last.toInt`) are acceptable and will be addressed when adding the concrete backend.
Learnt from: piyush-zlai
PR: zipline-ai/chronon#44
File: hub/test/store/DynamoDBMonitoringStoreTest.scala:69-86
Timestamp: 2024-10-15T15:33:22.265Z
Learning: In `hub/test/store/DynamoDBMonitoringStoreTest.scala`, the current implementation of the `generateListResponse` method is acceptable as-is, and changes for resource handling and error management are not necessary at this time.
Learnt from: piyush-zlai
PR: zipline-ai/chronon#44
File: hub/app/store/DynamoDBMonitoringStore.scala:98-143
Timestamp: 2024-10-15T15:30:15.514Z
Learning: In the Scala file `hub/app/store/DynamoDBMonitoringStore.scala`, within the `makeLoadedConfs` method, the `.recover` method is correctly applied to the `Try` returned by `response.values` to handle exceptions from the underlying store.
Learnt from: chewy-zlai
PR: zipline-ai/chronon#47
File: cloud_aws/src/main/scala/ai/chronon/integrations/aws/DynamoDBKVStoreImpl.scala:294-0
Timestamp: 2024-10-17T01:02:40.431Z
Learning: In `DynamoDBKVStoreImpl.scala`, when handling errors indicating that a row is missing a field in the database, it's acceptable to use the generic `Exception` type in methods like `extractListValues`.
Learnt from: tchow-zlai
PR: zipline-ai/chronon#263
File: cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala:56-57
Timestamp: 2025-01-24T23:55:40.650Z
Learning: For BigQuery table creation operations in BigQueryFormat.scala, allow exceptions to propagate directly without wrapping them in try-catch blocks, as the original BigQuery exceptions provide sufficient context.
Learnt from: chewy-zlai
PR: zipline-ai/chronon#50
File: spark/src/test/scala/ai/chronon/spark/test/MockKVStore.scala:13-16
Timestamp: 2024-10-31T18:27:44.973Z
Learning: In `MockKVStore.scala`, the `create` method should reset the dataset even if the dataset already exists.
⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: groupby_tests
  • GitHub Check: fetcher_tests
  • GitHub Check: analyzer_tests
  • GitHub Check: streaming_tests
  • GitHub Check: scala_compile_fmt_fix
  • GitHub Check: cloud_aws_tests
  • GitHub Check: spark_tests
  • GitHub Check: service_commons_tests
  • GitHub Check: online_tests
  • GitHub Check: batch_tests
  • GitHub Check: cloud_gcp_tests
  • GitHub Check: service_tests
  • GitHub Check: api_tests
  • GitHub Check: aggregator_tests
  • GitHub Check: flink_tests
  • GitHub Check: enforce_triggered_workflows
🔇 Additional comments (1)
spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherFailureTest.scala (1)

83-83: ```shell
#!/bin/bash

find exception handling in fetcher

rg -A5 -B5 "exception" spark/src/main/scala/ai/chronon/spark/fetcher


</details>

</blockquote></details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsv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Tt7yp3w9WUYy99pCxgf+GtS1C2sjnkL3tS3UoJe/wl1h9szrTOtRKVp8PIgfP+Bi+h4Wo5OTWGQT0ImKsUKfs8MFSQOrsrwp69Is+EkU6DMW+l+WIu6qA6iBQnIW8NO/afWXkIkyyumMMayLW3CogcuVOPwjy5mzyngKuHy6uacWuWchgBg64ViiUu4/Y8W0qI4p4fgaAF4Xu14nQpUVA94K4T4YAhg3BI42k8AtAiAWkAkKMMytAWkIIABz43BtAAALLQAIFfEsAwMUAAEwABsAAzIYZYQAOz2EAAcV8zhhhaAJAthSwLhhhjhphhhxQCwLh1hDAthnka47YkAjhKwAAjNYcUMYS4ZYUsLQNYQsMYdYdYXQiQCQCsN4QwGEZYXEQIEsHEQsAsLYZUY4SQAsLoPIVwdEQsHEQwHEbYbQJYSQEsLPsUEYeEWgI4XEXQL4XEY4R4ZYSsAsNkY4UYSsEsAIA0QodEQkZYWgCsNYQEWgGgK0ekbQAwFMY4SoHQNYSkQsCQPMLYXEaUMYUUQcUsS+FAEoUoioWoRoSQFobhtTPoEAA= -->

<!-- internal state end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=zipline-ai/chronon&utm_content=905):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `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 explain this code block.`
  -	`@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 explain its main purpose.`
  - `@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](https://www.coderabbit.ai/contact-us/support) 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 docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@varant-zlai varant-zlai force-pushed the vz/update-fetcher-test-short-name branch from e723743 to 91c13d2 Compare June 26, 2025 17:29
@varant-zlai varant-zlai merged commit a337194 into main Jun 27, 2025
20 checks passed
@varant-zlai varant-zlai deleted the vz/update-fetcher-test-short-name branch June 27, 2025 16:44
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.

4 participants