https://github.com/codesetuptest/django-django-11797

SWE-bench instance: django__django-11797

https://github.com/codesetuptest/django-django-11797

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (4.4%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

SWE-bench instance: django__django-11797

Basic Info
  • Host: GitHub
  • Owner: CodeSetupTest
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Size: 0 Bytes
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 12 months ago · Last pushed 12 months ago
Metadata Files
Readme Contributing Funding License Authors

README.md

SWE-bench Instance: django__django-11797

Repository: django/django Base Commit: 3346b78a8a872286a245d1e77ef4718fc5e6be1a

Problem Statement

Filtering on query result overrides GROUP BY of internal query Description

from django.contrib.auth import models a = models.User.objects.filter(email__isnull=True).values('email').annotate(m=Max('id')).values('m') print(a.query) # good

SELECT MAX("authuser"."id") AS "m" FROM "authuser" WHERE "authuser"."email" IS NULL GROUP BY "authuser"."email"

print(a[:1].query) # good

SELECT MAX("authuser"."id") AS "m" FROM "authuser" WHERE "authuser"."email" IS NULL GROUP BY "authuser"."email" LIMIT 1

b = models.User.objects.filter(id=a[:1]) print(b.query) # GROUP BY U0."id" should be GROUP BY U0."email"

SELECT ... FROM "authuser" WHERE "authuser"."id" = (SELECT U0."id" FROM "auth_user" U0 WHERE U0."email" IS NULL GROUP BY U0."id" LIMIT 1)

Repository Contents

This repository contains the actual source code from the original repository at commit 3346b78a8a872286a245d1e77ef4718fc5e6be1a. The code is ready for development and testing.

Docker Environment

A Dockerfile is provided to set up the proper environment for this instance:

bash docker build -t swebench-instance . docker run -it swebench-instance /bin/bash

Owner

  • Name: CodeSetupTest
  • Login: CodeSetupTest
  • Kind: organization

GitHub Events

Total
  • Create event: 2
Last Year
  • Create event: 2

Dependencies

Dockerfile docker
  • sweb.env.py.x86_64.a18371b03f944585b4f08c latest build
package.json npm
  • eslint ^4.18.2 development
  • grunt ^1.0.1 development
  • grunt-cli ^1.2.0 development
  • grunt-contrib-qunit ^1.2.0 development
setup.py pypi
  • asgiref *
  • pytz *
  • sqlparse *
tests/admin_scripts/custom_templates/project_template/additional_dir/requirements.txt pypi
tests/requirements/mysql.txt pypi
  • mysqlclient >=1.3.13 test
tests/requirements/oracle.txt pypi
  • cx_oracle >=6.0 test
tests/requirements/postgres.txt pypi
  • psycopg2 >=2.5.4 test
tests/requirements/py3.txt pypi
  • Pillow * test
  • PyYAML * test
  • argon2-cffi >=16.1.0 test
  • asgiref * test
  • bcrypt * test
  • docutils * test
  • geoip2 * test
  • jinja2 >=2.9.2 test
  • numpy * test
  • pylibmc * test
  • python-memcached >=1.59 test
  • pytz * test
  • pywatchman * test
  • selenium * test
  • sqlparse * test
  • tblib * test