From b34a7fc2f6a7cb44e859f00b410a1a3454878e1d Mon Sep 17 00:00:00 2001 From: Fabro Date: Mon, 16 Mar 2026 01:32:33 -0400 Subject: [PATCH] init run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⚒️ Generated with [Fabro](https://fabro.sh) --- graph.fabro | 31 +++++++++++++++++++++++++++++++ manifest.json | 13 +++++++++++++ sandbox.json | 5 +++++ 3 files changed, 49 insertions(+) create mode 100644 graph.fabro create mode 100644 manifest.json create mode 100644 sandbox.json diff --git a/graph.fabro b/graph.fabro new file mode 100644 index 000000000..44e2a016a --- /dev/null +++ b/graph.fabro @@ -0,0 +1,31 @@ +digraph SWEBench { + graph [goal="Upgrading 2.2>3.0 causes named tuples used as arguments to __range to error. +Description + +I noticed this while upgrading a project from 2.2 to 3.0. +This project passes named 2-tuples as arguments to range queryset filters. This works fine on 2.2. On 3.0 it causes the following error: TypeError: __new__() missing 1 required positional argument: 'far'. +This happens because django.db.models.sql.query.Query.resolve_lookup_value goes into the tuple elements to resolve lookups and then attempts to reconstitute the tuple with the resolved elements. +When it attempts to construct the new tuple it preserves the type (the named tuple) but it passes a iterator to it's constructor. +NamedTuples don't have the code path for copying an iterator, and so it errors on insufficient arguments. +The fix is to * expand the contents of the iterator into the constructor. +"] + rankdir=LR + + start [shape=Mdiamond] + exit [shape=Msquare] + + setup [label="Setup", shape=parallelogram, script="git clone https://github.com/django/django.git . && git checkout 755dbf39fcdc491fe9b588358303e259c7750be4 && python -m pip install -e ."] + solve [label="Solve", prompt="Fix this GitHub issue in the repository. Make the minimal code change needed.\n\nUpgrading 2.2>3.0 causes named tuples used as arguments to __range to error. +Description + +I noticed this while upgrading a project from 2.2 to 3.0. +This project passes named 2-tuples as arguments to range queryset filters. This works fine on 2.2. On 3.0 it causes the following error: TypeError: __new__() missing 1 required positional argument: 'far'. +This happens because django.db.models.sql.query.Query.resolve_lookup_value goes into the tuple elements to resolve lookups and then attempts to reconstitute the tuple with the resolved elements. +When it attempts to construct the new tuple it preserves the type (the named tuple) but it passes a iterator to it's constructor. +NamedTuples don't have the code path for copying an iterator, and so it errors on insufficient arguments. +The fix is to * expand the contents of the iterator into the constructor. +"] + extract_patch [label="Extract Patch", shape=parallelogram, script="git diff"] + + start -> setup -> solve -> extract_patch -> exit +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 000000000..1a0cd1d44 --- /dev/null +++ b/manifest.json @@ -0,0 +1,13 @@ +{ + "run_id": "01KKTJ36XVQF9JY9Q8SBGN8BKP", + "workflow_name": "SWEBench", + "goal": "Upgrading 2.2>3.0 causes named tuples used as arguments to __range to error.\nDescription\n\t\nI noticed this while upgrading a project from 2.2 to 3.0.\nThis project passes named 2-tuples as arguments to range queryset filters. This works fine on 2.2. On 3.0 it causes the following error: TypeError: __new__() missing 1 required positional argument: 'far'.\nThis happens because django.db.models.sql.query.Query.resolve_lookup_value goes into the tuple elements to resolve lookups and then attempts to reconstitute the tuple with the resolved elements.\nWhen it attempts to construct the new tuple it preserves the type (the named tuple) but it passes a iterator to it's constructor.\nNamedTuples don't have the code path for copying an iterator, and so it errors on insufficient arguments.\nThe fix is to * expand the contents of the iterator into the constructor.\n", + "start_time": "2026-03-16T05:32:33.614389Z", + "node_count": 5, + "edge_count": 4, + "run_branch": "fabro/run/01KKTJ36XVQF9JY9Q8SBGN8BKP", + "base_sha": "470fcfe1200b2102c0cdf91c73b0ed8d925f258a", + "base_branch": "main", + "workflow_slug": "django__django-13590", + "host_repo_path": "/Users/bhelmkamp/p/fabro-sh/fabro/evals/swe-bench/results/haiku-baseline/runs/django__django-13590" +} \ No newline at end of file diff --git a/sandbox.json b/sandbox.json new file mode 100644 index 000000000..de0c7435a --- /dev/null +++ b/sandbox.json @@ -0,0 +1,5 @@ +{ + "provider": "daytona", + "working_directory": "/home/daytona/workspace", + "identifier": "fabro-01KKTJ36XVQF9JY9Q8SBGN8BKP" +} \ No newline at end of file