nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: googleapis/java-datastore
Pull request #1271 (2023-12-27 18:03:48)

test(deps): upgrade errorprone to 2.24.0
Opening in favor of #1269 


Patch:
diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml
index 172f54c6..bc30cf7e 100644
--- a/google-cloud-datastore/pom.xml
+++ b/google-cloud-datastore/pom.xml
@@ -118,6 +118,13 @@
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
+
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava-testlib</artifactId>
+      <version>33.0.0-jre</version>
+      <scope>test</scope>
+    </dependency>
     <!-- Need testing utility classes for generated gRPC clients tests -->
     <dependency>
       <groupId>com.google.api</groupId>
diff --git a/pom.xml b/pom.xml
index 6de18bec..bd6c8ac1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -143,7 +143,7 @@
     <github.global.server>github</github.global.server>
     <site.installationModule>google-cloud-datastore-parent</site.installationModule>
     <project.javadoc.protobufBaseURL>https://googleapis.dev/java/google-api-grpc/latest</project.javadoc.protobufBaseURL>
-    <error-prone.version>2.23.0</error-prone.version>
+    <error-prone.version>2.24.0</error-prone.version>
   </properties>
 
   <dependencyManagement>


Test patch:
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobTest.java
index 55d5f031..391f6f76 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobTest.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
 
+import com.google.common.testing.EqualsTester;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.nio.ByteBuffer;
@@ -46,7 +47,8 @@ public class BlobTest {
 
   @Test
   public void testEquals() {
-    assertEquals(blob1, blob1);
+    EqualsTester equalsTester = new EqualsTester();
+    equalsTester.addEqualityGroup(blob1, blob1).testEquals();
     assertEquals(blob1, Blob.copyFrom(bytes1));
     assertNotEquals(blob1, blob2);
   }
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngTest.java
index e8076eba..9363fc15 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngTest.java
@@ -19,6 +19,7 @@ package com.google.cloud.datastore;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 
+import com.google.common.testing.EqualsTester;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -40,7 +41,8 @@ public class LatLngTest {
 
   @Test
   public void testEquals() {
-    assertEquals(gp1, gp1);
+    EqualsTester equalsTester = new EqualsTester();
+    equalsTester.addEqualityGroup(gp1, gp1).testEquals();
     assertNotEquals(gp1, gp2);
   }
Repository: googleapis/java-spanner-jdbc
Pull request #1919 (2025-02-17 08:59:09)

feat: support FOR UPDATE clauses
Spanner now supports FOR UPDATE clauses. This is now also reflected in the DatabaseMetaData returned by the JDBC driver.

See also https://cloud.google.com/spanner/docs/release-notes#January_27_2025



Patch:
diff --git a/src/main/java/com/google/cloud/spanner/jdbc/JdbcDatabaseMetaData.java b/src/main/java/com/google/cloud/spanner/jdbc/JdbcDatabaseMetaData.java
index 6cb6f3e..bdebcad 100644
--- a/src/main/java/com/google/cloud/spanner/jdbc/JdbcDatabaseMetaData.java
+++ b/src/main/java/com/google/cloud/spanner/jdbc/JdbcDatabaseMetaData.java
@@ -479,7 +479,7 @@ class JdbcDatabaseMetaData extends AbstractJdbcWrapper implements DatabaseMetaDa
 
   @Override
   public boolean supportsSelectForUpdate() {
-    return false;
+    return true;
   }
 
   @Override


Test patch:
diff --git a/src/test/java/com/google/cloud/spanner/jdbc/JdbcDatabaseMetaDataTest.java b/src/test/java/com/google/cloud/spanner/jdbc/JdbcDatabaseMetaDataTest.java
index 193fc96..47ab2e5 100644
--- a/src/test/java/com/google/cloud/spanner/jdbc/JdbcDatabaseMetaDataTest.java
+++ b/src/test/java/com/google/cloud/spanner/jdbc/JdbcDatabaseMetaDataTest.java
@@ -250,7 +250,7 @@ public class JdbcDatabaseMetaDataTest {
     assertTrue(meta.supportsSchemasInPrivilegeDefinitions());
     assertTrue(meta.supportsSchemasInProcedureCalls());
     assertTrue(meta.supportsSchemasInTableDefinitions());
-    assertFalse(meta.supportsSelectForUpdate());
+    assertTrue(meta.supportsSelectForUpdate());
     assertFalse(meta.supportsStatementPooling());
     assertFalse(meta.supportsStoredFunctionsUsingCallSyntax());
     assertFalse(meta.supportsStoredProcedures());
Repository: getmoto/moto
Pull request #6723 (2023-08-24 20:25:08)

Techdebt: Paginator should support OrderedDict's


Patch:
diff --git a/moto/utilities/paginator.py b/moto/utilities/paginator.py
index ce411e49d..313605843 100644
--- a/moto/utilities/paginator.py
+++ b/moto/utilities/paginator.py
@@ -149,7 +149,7 @@ class Paginator:
             token_dict["parameterChecksum"] = self._param_checksum
         range_keys = []
         for attr in self._unique_attributes:
-            if type(next_item) == dict:
+            if isinstance(next_item, dict):
                 range_keys.append(str(next_item[attr]))
             else:
                 range_keys.append(str(getattr(next_item, attr)))


Test patch:
diff --git a/tests/test_utilities/test_paginator.py b/tests/test_utilities/test_paginator.py
index 57ac62c67..5a5b5a830 100644
--- a/tests/test_utilities/test_paginator.py
+++ b/tests/test_utilities/test_paginator.py
@@ -1,3 +1,4 @@
+from collections import OrderedDict
 import unittest
 
 import pytest
@@ -38,6 +39,12 @@ def test_paginator__paginate_with_just_max_results():
     assert page == results
 
 
+def test_paginator__ordered_dict():
+    p = Paginator(max_results=1, unique_attribute="id")
+    page, _ = p.paginate([OrderedDict(x) for x in results])
+    assert len(page) == 1
+
+
 def test_paginator__paginate_without_range_key__throws_error():
     p = Paginator(max_results=2)
     with pytest.raises(KeyError):
Repository: googleapis/java-storage
Pull request #1998 (2023-04-26 15:21:56)

fix: introduce new BlobId#toGsUtilUriWithGeneration
When BlobId#toGsUtilUri was updated to output generation if defined, this broken older clients ability to parse the value via BlobId#fromGsUtilUri. This adds the new method toGsUtilUriWithGeneration to explicitly opt in to generation being okay in the output.

Related to #1928
Related to #1929




Patch:
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java
index c1914d6a..1fa1245e 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java
@@ -58,8 +58,21 @@ public final class BlobId implements Serializable {
     return generation;
   }
 
-  /** Returns this blob's Storage url which can be used with gsutil */
+  /**
+   * Returns this blob's Storage url which can be used with gsutil. If {@link #generation} is
+   * non-null it will not be included in the uri.
+   */
   public String toGsUtilUri() {
+    return "gs://" + bucket + "/" + name;
+  }
+
+  /**
+   * Returns this blob's Storage url which can be used with gsutil. If {@link #generation} is
+   * non-null it will be included in the uri
+   *
+   * @since 2.23.0
+   */
+  public String toGsUtilUriWithGeneration() {
     return "gs://" + bucket + "/" + name + (generation == null ? "" : ("#" + generation));
   }
 


Test patch:
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java
index 03bf2218..f1c37ce1 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java
@@ -45,7 +45,8 @@ public class BlobIdTest {
     assertEquals("bucket", blobId.getBucket());
     assertEquals("path/to/blob", blobId.getName());
     assertEquals(Long.valueOf(1360887697105000L), blobId.getGeneration());
-    assertEquals("gs://bucket/path/to/blob#1360887697105000", blobId.toGsUtilUri());
+    assertEquals("gs://bucket/path/to/blob", blobId.toGsUtilUri());
+    assertEquals("gs://bucket/path/to/blob#1360887697105000", blobId.toGsUtilUriWithGeneration());
   }
 
   @Test