-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Go] Support Array Diff #34790
Comments
I am happy to submit a PR for this. Currently I'm thinking it would go into a arrow/cpp/src/arrow/array/diff.cc Lines 113 to 123 in ddd0a33
We can also consider exposing an internal function that returns the differences in Struct format, rather than as a string. |
I have broken the implementation into two parts:
|
This adds an `array.Diff` function that returns an edit script that, when applied to `base`, produces `target`. This mirrors the C++ implementation. It does not yet include a string diff formatter. This can be done in a follow-up. * Closes: #34790 Authored-by: Herman Schaaf <hermanschaaf@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
This adds a `UnifiedDiff(base, target arrow.Array)` method to the `array.Edits` type. It returns a string diff in Unified Diff format. This makes use of the `array.Edits` type returned by the `arrays.Diff()` function added in #34806 - Part of #34790 Authored-by: Herman Schaaf <hermanschaaf@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
This adds a `UnifiedDiff(base, target arrow.Array)` method to the `array.Edits` type. It returns a string diff in Unified Diff format. This makes use of the `array.Edits` type returned by the `arrays.Diff()` function added in apache#34806 - Part of apache#34790 Authored-by: Herman Schaaf <hermanschaaf@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
This adds an `array.Diff` function that returns an edit script that, when applied to `base`, produces `target`. This mirrors the C++ implementation. It does not yet include a string diff formatter. This can be done in a follow-up. * Closes: apache#34790 Authored-by: Herman Schaaf <hermanschaaf@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
This adds a `UnifiedDiff(base, target arrow.Array)` method to the `array.Edits` type. It returns a string diff in Unified Diff format. This makes use of the `array.Edits` type returned by the `arrays.Diff()` function added in apache#34806 - Part of apache#34790 Authored-by: Herman Schaaf <hermanschaaf@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
This adds an `array.Diff` function that returns an edit script that, when applied to `base`, produces `target`. This mirrors the C++ implementation. It does not yet include a string diff formatter. This can be done in a follow-up. * Closes: apache#34790 Authored-by: Herman Schaaf <hermanschaaf@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
This adds a `UnifiedDiff(base, target arrow.Array)` method to the `array.Edits` type. It returns a string diff in Unified Diff format. This makes use of the `array.Edits` type returned by the `arrays.Diff()` function added in apache#34806 - Part of apache#34790 Authored-by: Herman Schaaf <hermanschaaf@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
This adds a `UnifiedDiff(base, target arrow.Array)` method to the `array.Edits` type. It returns a string diff in Unified Diff format. This makes use of the `array.Edits` type returned by the `arrays.Diff()` function added in apache/arrow#34806 - Part of apache/arrow#34790 Authored-by: Herman Schaaf <hermanschaaf@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Describe the enhancement requested
Similar to the CPP implementation of Array Diff (Python docs: https://arrow.apache.org/docs/python/generated/pyarrow.Array.html#pyarrow.Array.diff) it would be good to have the same in Go. As far as I can tell, there is an
array.Equal
in Go right now, but notarray.Diff
.Like its CPP counterpart, given two string arrays
["one", "two", "three"]
and["two", None, "two-and-a-half", "three"]
it would output a string like this:Component(s)
Go
The text was updated successfully, but these errors were encountered: