nebius/SWE-bench-extra huggingface dataset:
Repository: Clinical-Genomics/scout

Issue:
CADD score filter monday-issue! 
Thank you kindly for the quick inclusion of CADD score filtering! Will make a couple of our doctors very happy.

One major caveat though: the current version seems to filter out unknown CADD scores as well (similar to the unknown frequency bug)! Not intended usage..


Comments:

Patch:
diff --git a/scout/adapter/mongo/query.py b/scout/adapter/mongo/query.py
index 3a07b82d8..055963b99 100644
--- a/scout/adapter/mongo/query.py
+++ b/scout/adapter/mongo/query.py
@@ -114,15 +114,16 @@ class QueryHandler(object):
             cadd_query = {'cadd_score': {'$gt': float(cadd)}}
             logger.debug("Adding cadd_score: %s to query" % cadd)
 
-            if query.get('cadd_inclusive') == 'yes':
+            if query.get('cadd_inclusive') == True:
                 cadd_query = {
                     '$or': [
                         cadd_query,
                         {'cadd_score': {'$exists': False}}
-                    ]}
+                        ]}
                 logger.debug("Adding cadd inclusive to query")
 
             mongo_query['$and'].append(cadd_query)
+                    
 
         if query.get('genetic_models'):
             models = query['genetic_models']


Test patch:
diff --git a/tests/adapter/test_query.py b/tests/adapter/test_query.py
index e5aee3586..2d12aa555 100644
--- a/tests/adapter/test_query.py
+++ b/tests/adapter/test_query.py
@@ -57,7 +57,7 @@ def test_build_cadd_exclusive(adapter):
 def test_build_cadd_inclusive(adapter):
     case_id = 'cust000'
     cadd = 10.0
-    cadd_inclusive = 'yes'
+    cadd_inclusive = True
     query = {'cadd_score': cadd, 'cadd_inclusive': cadd_inclusive}
 
     mongo_query = adapter.build_query(case_id, query=query)
Repository: CybOXProject/mixbox

Issue:
DateField does not properly serialize datetime objects
When storing a Python `datetime` object in a property specified by a `DateField`, the value incorrectly serializes to an ISO timestamp (`YYYY-MM-DDThh:mm:ss`) instead of to a `xs:date` format (`YYYY-MM-DD`).

    class Foo(Entity):
        my_date = DateField("my_date");

    obj = Foo()
    obj.my_date = datetime.datetime.now()

There are two issues:

* the `DateField::binding_value` function uses `serialize_datetime` instead of `serialize_date`

* the `serialize_date` function erroneously includes time information in its output when processing datetimes

Comments:

Patch:
diff --git a/mixbox/dates.py b/mixbox/dates.py
index be279e1..794e0b0 100644
--- a/mixbox/dates.py
+++ b/mixbox/dates.py
@@ -73,10 +73,10 @@ def serialize_date(value):
     """
     if not value:
         return None
-    elif isinstance(value, datetime.date):
-        return value.isoformat()
     elif isinstance(value, datetime.datetime):
         return value.date().isoformat()
+    elif isinstance(value, datetime.date):
+        return value.isoformat()
     else:
         return parse_date(value).isoformat()
 
diff --git a/mixbox/fields.py b/mixbox/fields.py
index f623c6b..cad106a 100644
--- a/mixbox/fields.py
+++ b/mixbox/fields.py
@@ -373,7 +373,7 @@ class DateField(TypedField):
         return serialize_date(value)
 
     def binding_value(self, value):
-        return serialize_datetime(value)
+        return serialize_date(value)
 
 
 class CDATAField(TypedField):


Test patch:
diff --git a/tests/dates_tests.py b/tests/dates_tests.py
index f139939..d3be86b 100644
--- a/tests/dates_tests.py
+++ b/tests/dates_tests.py
@@ -15,6 +15,12 @@ class DatesTests(unittest.TestCase):
         dstr = "2015-04-01"
         parsed = dates.parse_date(dstr)
         self.assertEqual(dstr, parsed.isoformat())
+        
+    def test_serialize_datetime_as_date(self):
+        now = dates.now()
+        self.assertTrue(isinstance(now, datetime.datetime))
+        nowstr = dates.serialize_date(now)
+        self.assertEquals(nowstr, now.date().isoformat())
 
     def test_parse_datetime(self):
         dtstr = '2015-04-02T16:44:30.423149+00:00'