Skip to content
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

Introduce JsonPathString #3674

Merged
merged 2 commits into from
Feb 23, 2024
Merged

Introduce JsonPathString #3674

merged 2 commits into from
Feb 23, 2024

Conversation

xzfc
Copy link
Contributor

@xzfc xzfc commented Feb 23, 2024

Part 1/3 of #3637 (comment).

Roadmap/general idea: let the new and the old implementation coexist for a while. Introduce a new trait that both implementations will implement. Use the same set of unit tests for both implementations.

This PR adds a new trait JsonPathInterface and its implementation JsonPathString which behaves exactly like the old implementation.
All the code is updated to use the new interface. These are mostly mechanical changes in tests.

Additionally, this PR adds an empty stub implementation of JsonPathV2 just to check that everything compiles if we replace the old implementation with the new one. It panics though.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Member

Choose a reason for hiding this comment

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

With a trait like this it seems a bit like over engineering, but I get that we only do this during the migration period. So then I'd be fine to keep it like this 👍

lib/segment/src/json_path/string.rs Outdated Show resolved Hide resolved
@generall
Copy link
Member

Please separate implementation and integration next time. 1000+ lines is still too big

@generall generall merged commit 0ed86ce into dev Feb 23, 2024
17 checks passed
@generall generall deleted the json-path-trait branch February 23, 2024 14:38
@xzfc xzfc mentioned this pull request Mar 4, 2024
9 tasks
timvisee pushed a commit that referenced this pull request Mar 5, 2024
* Introduce JsonPathString

* Fix fomatting
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.

None yet

3 participants