nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: FundingCircle/jackdaw
Pull request #15 (2018-12-17 18:31:51)

Upgrade to Kafka 210 and CP 510


Patch:
diff --git a/project.clj b/project.clj
index 887ae30..c01759d 100644
--- a/project.clj
+++ b/project.clj
@@ -7,17 +7,17 @@
                  ;; Confluent does paired releases with Kafka, this should tie
                  ;; off with the kafka version.
                  ;; See https://docs.confluent.io/current/release-notes.html
-                 [io.confluent/kafka-avro-serializer "5.0.0"]
-                 [io.confluent/kafka-connect-avro-converter "5.0.0"]
-                 [io.confluent/kafka-connect-jdbc "5.0.0"]
-                 [io.confluent/kafka-schema-registry "5.0.0"]
-                 [io.confluent/kafka-schema-registry-client "5.0.0"]
-                 [org.apache.kafka/connect-api "2.0.0"]
-                 [org.apache.kafka/connect-json "2.0.0"]
-                 [org.apache.kafka/connect-runtime "2.0.0"]
-                 [org.apache.kafka/kafka-clients "2.0.0"]
-                 [org.apache.kafka/kafka-streams "2.0.0"]
-                 [org.apache.kafka/kafka_2.11 "2.0.0"]
+                 [io.confluent/kafka-avro-serializer "5.1.0"]
+                 [io.confluent/kafka-connect-avro-converter "5.1.0"]
+                 [io.confluent/kafka-connect-jdbc "5.1.0"]
+                 [io.confluent/kafka-schema-registry "5.1.0"]
+                 [io.confluent/kafka-schema-registry-client "5.1.0"]
+                 [org.apache.kafka/connect-api "2.1.0"]
+                 [org.apache.kafka/connect-json "2.1.0"]
+                 [org.apache.kafka/connect-runtime "2.1.0"]
+                 [org.apache.kafka/kafka-clients "2.1.0"]
+                 [org.apache.kafka/kafka-streams "2.1.0"]
+                 [org.apache.kafka/kafka_2.11 "2.1.0"]
                  [org.clojure/clojure "1.9.0"]
                  [org.clojure/data.json "0.2.6"]
                  [org.clojure/tools.logging "0.3.1"]
@@ -70,7 +70,7 @@
                                [clj-http "2.3.0"]
                                [environ "1.1.0"]
                                [junit "4.12"]
-                               [org.apache.kafka/kafka-streams-test-utils "2.0.0" :scope "test"]
+                               [org.apache.kafka/kafka-streams-test-utils "2.1.0" :scope "test"]
                                [org.clojure/java.jdbc "0.7.0-beta2"]
                                [org.clojure/test.check "0.9.0"]
                                [org.clojure/tools.nrepl "0.2.12"]


Test patch:
diff --git a/test/jackdaw/serdes/avro_test.clj b/test/jackdaw/serdes/avro_test.clj
index e9f8e45..e450b96 100644
--- a/test/jackdaw/serdes/avro_test.clj
+++ b/test/jackdaw/serdes/avro_test.clj
@@ -483,5 +483,5 @@
     (is (= (String. (round-trip serde "bananas" (.getBytes "hello")))
            "hello"))
 
-    (is (thrown? org.apache.kafka.common.errors.SerializationException
+    (is (thrown? java.lang.IllegalArgumentException
                  (round-trip serde "bananas" {:hello 3})))))
Repository: FundingCircle/jackdaw
Pull request #21 (2018-12-27 12:32:00)

Make EDN serde configurable
Hello, 

I would like to use custom EDN readers with the EDN serde. This patch allows passing options to `edn/read-string` and make this configurable.

Would you like to merge this?

Thanks, r0man.

AndreaCrotti: Hi @r0man and thanks for your PR, we just fixed the build now for external PRs, could you please rebase your branch on master to allow CircleCI to do its job?
Thanks
r0man: @AndreaCrotti done
99-not-out: More rebasing needed I'm afraid ... I'll merge this one then we can deal with #22

Patch:
diff --git a/src/jackdaw/serdes/edn.clj b/src/jackdaw/serdes/edn.clj
index d62989a..b596d22 100644
--- a/src/jackdaw/serdes/edn.clj
+++ b/src/jackdaw/serdes/edn.clj
@@ -27,12 +27,15 @@
 
 (defn deserializer
   "Returns an EDN deserializer."
-  []
-  (jsfn/new-deserializer {:deserialize (fn [_ _ data]
-                                         (-> (from-bytes data)
-                                             clojure.edn/read-string))}))
+  ([]
+   (deserializer {}))
+  ([opts]
+   (let [opts (into {} opts)]
+     (jsfn/new-deserializer {:deserialize (fn [_ _ data]
+                                            (->> (from-bytes data)
+                                                 (clojure.edn/read-string opts)))}))))
 
 (defn serde
   "Returns an EDN serde."
-  []
-  (Serdes/serdeFrom (serializer) (deserializer)))
+  [& [opts]]
+  (Serdes/serdeFrom (serializer) (deserializer opts)))


Test patch:
diff --git a/test/jackdaw/serdes/edn_test.clj b/test/jackdaw/serdes/edn_test.clj
index f2cbf1b..2318fb7 100644
--- a/test/jackdaw/serdes/edn_test.clj
+++ b/test/jackdaw/serdes/edn_test.clj
@@ -1,5 +1,6 @@
 (ns jackdaw.serdes.edn-test
-  (:require [clojure.test :refer :all]
+  (:require [clojure.spec.alpha :as s]
+            [clojure.test :refer :all]
             [clojure.test.check.clojure-test :refer [defspec]]
             [clojure.test.check.generators :as gen]
             [clojure.test.check.properties :as prop]
@@ -18,3 +19,15 @@
         (is (= (seq bytes)
                (seq (->> (.deserialize (jse/deserializer) nil bytes)
                          (.serialize (jse/serializer) nil)))))))))
+
+(defmethod print-method java.net.URI
+  [obj writer]
+  (.write writer "#jackdaw/uri ")
+  (.write writer (pr-str (str obj))))
+
+(defspec edn-roundtrip-custom-reader 20
+  (testing "custom EDN reader"
+    (let [opts {:readers {'jackdaw/uri #(java.net.URI. %)}}]
+      (prop/for-all [x (s/gen uri?)]
+        (is (= x (->> (.serialize (jse/serializer) nil x)
+                      (.deserialize (jse/deserializer opts) nil))))))))