Skip to content

chore: rmreplace_columns, unused code #1251

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

Merged
merged 4 commits into from
Mar 24, 2025
Merged

Conversation

de-sh
Copy link
Contributor

@de-sh de-sh commented Mar 18, 2025

#1218 (comment)

Fixes #XXXX.

Description


This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor
    • Removed the replace_columns function and associated logic for column replacement in record batches.
  • Bug Fixes
    • Addressed potential compilation errors by removing uninitialized variable references in the into_recordbatch method.
  • Chores
    • Cleaned up unused import statements and deleted commented-out example functions.

Copy link
Contributor

coderabbitai bot commented Mar 18, 2025

Walkthrough

This pull request involves the removal of the rb variable initialization in the into_recordbatch method of the EventFormat trait, which leads to potential uninitialized variable usage. Additionally, the replace_columns function has been completely eliminated from the src/utils/arrow/mod.rs file, along with its documentation and test cases, resulting in a loss of functionality related to column replacement in record batches.

Changes

File Change Summary
src/event/format/mod.rs Removed initialization of rb in into_recordbatch, leading to potential uninitialized variable usage.
src/utils/arrow/mod.rs Removed the replace_columns function and its associated documentation and tests, eliminating the functionality for replacing specified columns in record batches.

Possibly related PRs

  • refactor: Event per log, streamline data handling #1209: The changes in the main PR, specifically the modifications to the into_recordbatch method in the EventFormat trait, are related to the changes in the retrieved PR, which also involves the Event struct and its handling, particularly through the into_event method. Both PRs focus on the event processing logic, indicating a direct connection at the code level.

Suggested reviewers

  • nikhilsinhaparseable

Poem

I'm a rabbit of code so spry,
Hopping through changes with a gleam in my eye.
With fields uninitialized, oh what a plight,
And columns replaced, now out of sight.
Code and carrots, side by side – oh my!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 18, 2025
de-sh pushed a commit to de-sh/parseable that referenced this pull request Mar 18, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 18, 2025
@de-sh de-sh requested a review from nitisht March 19, 2025 06:57
@de-sh de-sh changed the title refactor: replace_columns chore: rmreplace_columns, unused code Mar 21, 2025
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: 1

🔭 Outside diff range comments (1)
src/utils/arrow/mod.rs (1)

1-200: 🛠️ Refactor suggestion

Consider documenting the removal of public API

The removal of replace_columns constitutes a breaking change to the public API of this module. When removing public functions, it's a good practice to:

  1. Document the rationale for the removal
  2. Provide migration guidance for users of the function
  3. Consider versioning implications

Since this appears to be a refactoring rather than just a removal, please ensure there's appropriate documentation explaining how to achieve the same functionality with the new approach.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 367a5a6 and 1c0e509.

📒 Files selected for processing (2)
  • src/event/format/mod.rs (0 hunks)
  • src/utils/arrow/mod.rs (2 hunks)
💤 Files with no reviewable changes (1)
  • src/event/format/mod.rs
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: coverage
  • GitHub Check: Build Default x86_64-pc-windows-msvc
  • GitHub Check: Build Default x86_64-apple-darwin
  • GitHub Check: Build Default x86_64-unknown-linux-gnu
  • GitHub Check: Build Default aarch64-unknown-linux-gnu
  • GitHub Check: Build Default aarch64-apple-darwin
  • GitHub Check: Build Kafka aarch64-apple-darwin
  • GitHub Check: Build Kafka x86_64-unknown-linux-gnu
  • GitHub Check: Quest Smoke and Load Tests for Standalone deployments
  • GitHub Check: Quest Smoke and Load Tests for Distributed deployments
🔇 Additional comments (2)
src/utils/arrow/mod.rs (2)

25-25:

❓ Verification inconclusive

Import changes might affect dependent code

The import was modified to remove Array from the arrow_array imports. This indicates that the Array type is no longer needed in this module, which is consistent with the removal of functionality that might have used it.

This change seems reasonable, assuming all code that previously relied on this import has been addressed, but verify that related functionality in other files has been updated accordingly.


🏁 Script executed:

#!/bin/bash
# Check if there are any remaining references to Array from arrow_array that might now be broken
rg "arrow_array::Array" --type rust

Length of output: 35


Verification Notice: Confirm no dependent usage of arrow_array::Array remains

Based on an updated repository-wide search (using rg "arrow_array::Array" --type rust), there were no hits indicating any remaining references to arrow_array::Array. This suggests that the removal in src/utils/arrow/mod.rs is complete. However, because the search output was minimal, please manually verify that no dependent code relies on this import (or indirectly on the removed functionality).

• Verify across the codebase that no grouped imports or indirect references are attempting to use Array from arrow_array.

If manual confirmation or additional testing shows no negative impact, you can consider this import change acceptable.


99-150:

✅ Verification successful

Verify that add_parseable_fields still works without replace_columns

The add_parseable_fields function creates a new record batch with additional fields. According to the AI summary, there was a related change in another file where a line initializing the rb variable in into_recordbatch method was removed.

Please verify that after removing replace_columns, the add_parseable_fields function is still being called with properly initialized record batches throughout the codebase.


🏁 Script executed:

#!/bin/bash
# Look for calls to add_parseable_fields to ensure they're providing initialized record batches
rg "add_parseable_fields\(" -A 2 -B 2 --type rust

# Check the into_recordbatch method to see how rb is being initialized now
rg "into_recordbatch" -A 10 -B 10 --type rust

Length of output: 16661


Confirm proper batch initialization after removing replace_columns

The investigation confirms that all calls to add_parseable_fields are still receiving well-formed record batches. In particular:

  • In src/event/format/mod.rs, the record batch generated by Self::decode is passed to add_parseable_fields with all expected fields.
  • In src/handlers/http/ingest.rs, tests calling the into_recordbatch method (which internally uses add_parseable_fields) verify that the record batches have the correct schema, row count, and columns.

No issues were found with the initialization process after the removal of replace_columns.

Copy link
Contributor

@nikhilsinhaparseable nikhilsinhaparseable left a comment

Choose a reason for hiding this comment

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

good to merge

@nitisht nitisht merged commit d8b3cb7 into parseablehq:main Mar 24, 2025
14 checks passed
@de-sh de-sh deleted the reflect branch March 24, 2025 06:40
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