nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: Materials-Consortia/optimade-python-tools
Pull request #225 (2020-03-12 15:50:53)

Add txt-files in optimade.validator.data to MANIFEST
Also added to `test_setup.py` test.

I found this error, since I couldn't install the latest commit when testing Materials-Consortia/optimade-validator-action#4

codecov[bot]: # [Codecov](https://codecov.io/gh/Materials-Consortia/optimade-python-tools/pull/225?src=pr&el=h1) Report
> Merging [#225](https://codecov.io/gh/Materials-Consortia/optimade-python-tools/pull/225?src=pr&el=desc) into [master](https://codecov.io/gh/Materials-Consortia/optimade-python-tools/commit/5a5e9039997e7095661cb2b24bcff2ed5ba44a34&el=desc) will **not change** coverage by `%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/Materials-Consortia/optimade-python-tools/pull/225/graphs/tree.svg?width=650&height=150&src=pr&token=UJAtmqkZZO)](https://codecov.io/gh/Materials-Consortia/optimade-python-tools/pull/225?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #225   +/-   ##
=======================================
  Coverage   87.55%   87.55%           
=======================================
  Files          43       43           
  Lines        1912     1912           
=======================================
  Hits         1674     1674           
  Misses        238      238           
```

| Flag | Coverage Δ | |
|---|---|---|
| #unittests | `87.55% <ø> (ø)` | |


------

[Continue to review full report at Codecov](https://codecov.io/gh/Materials-Consortia/optimade-python-tools/pull/225?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Materials-Consortia/optimade-python-tools/pull/225?src=pr&el=footer). Last update [5a5e903...260f2fe](https://codecov.io/gh/Materials-Consortia/optimade-python-tools/pull/225?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

CasperWA: > Thanks for catching this, assume this is no problem for #214.

It seems he will [start over](https://github.com/Materials-Consortia/optimade-python-tools/pull/224#issuecomment-598340949) 😮 

Patch:
diff --git a/MANIFEST.in b/MANIFEST.in
index 4a047b4d..ad0839c8 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,4 @@
 recursive-include optimade/server/ *.ini *.json
 recursive-include optimade/server/data/ *
 recursive-include optimade/grammar/ *.lark
+recursive-include optimade/validator/data/ *.txt


Test patch:
diff --git a/tests/test_setup.py b/tests/test_setup.py
index ff972b7a..408df991 100644
--- a/tests/test_setup.py
+++ b/tests/test_setup.py
@@ -35,6 +35,8 @@ class TestSetup(unittest.TestCase):
                 r"test_structures\.json": False,
                 r"test_references\.json": False,
                 r"test_links\.json": False,
+                r"filters\.txt": False,
+                r"optional_filters\.txt": False,
             }
             count = 0
             for line in lines:
Repository: react-hook-form/resolvers
Pull request #656 (2023-12-29 19:32:41)

Fixes error handling for array errors with root error
Fixes https://github.com/react-hook-form/resolvers/issues/629

Issue:
If you had a field array with two elements and an error in the second element THEN a root error, `.compact` would recognize the second element error as an error in the first element.

Solution:
Get rid of `.compact`


Patch:
diff --git a/src/toNestErrors.ts b/src/toNestErrors.ts
index 5c4b839..e68d3d3 100644
--- a/src/toNestErrors.ts
+++ b/src/toNestErrors.ts
@@ -23,10 +23,7 @@ export const toNestErrors = <TFieldValues extends FieldValues>(
     });
 
     if (isNameInFieldArray(options.names || Object.keys(errors), path)) {
-      const fieldArrayErrors = Object.assign(
-        {},
-        compact(get(fieldErrors, path)),
-      );
+      const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));
 
       set(fieldArrayErrors, 'root', error);
       set(fieldErrors, path, fieldArrayErrors);
@@ -38,9 +35,6 @@ export const toNestErrors = <TFieldValues extends FieldValues>(
   return fieldErrors;
 };
 
-const compact = <TValue>(value: TValue[]) =>
-  Array.isArray(value) ? value.filter(Boolean) : [];
-
 const isNameInFieldArray = (
   names: InternalFieldName[],
   name: InternalFieldName,


Test patch:
diff --git a/src/__tests__/toNestErrors.ts b/src/__tests__/toNestErrors.ts
index 6ac0df6..983fdde 100644
--- a/src/__tests__/toNestErrors.ts
+++ b/src/__tests__/toNestErrors.ts
@@ -204,3 +204,54 @@ test('transforms flat object to nested object with root error for field array',
     ],
   });
 });
+
+test('ensures consistent ordering when a field array has a root error and an error in the non-first element', () => {
+  const result = toNestErrors(
+    {
+      'fieldArrayWithRootError.1.name': {
+        type: 'second',
+        message: 'second message',
+      },
+      fieldArrayWithRootError: { type: 'root-error', message: 'root message' },
+    },
+    {
+      fields: {
+        fieldArrayWithRootError: {
+          name: 'fieldArrayWithRootError',
+          ref: { name: 'fieldArrayWithRootError' },
+        },
+        'fieldArrayWithRootError.0.name': {
+          name: 'fieldArrayWithRootError.0.name',
+          ref: { name: 'fieldArrayWithRootError.0.name' },
+        },
+        'fieldArrayWithRootError.1.name': {
+          name: 'fieldArrayWithRootError.1.name',
+          ref: { name: 'fieldArrayWithRootError.1.name' },
+        },
+      },
+      names: [
+        'fieldArrayWithRootError',
+        'fieldArrayWithRootError.0.name',
+        'fieldArrayWithRootError.1.name',
+      ],
+      shouldUseNativeValidation: false,
+    },
+  );
+
+  expect(result).toEqual({
+    fieldArrayWithRootError: {
+      '1': {
+        name: {
+          type: 'second',
+          message: 'second message',
+          ref: { name: 'fieldArrayWithRootError.1.name' },
+        },
+      },
+      root: {
+        type: 'root-error',
+        message: 'root message',
+        ref: { name: 'fieldArrayWithRootError' },
+      },
+    },
+  });
+});