internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: facebookresearch/Mephisto

Issue:
Cypress Testing is Broken
Seems frontend testing via Cypress is broken right now. he GH action is loading cypress 12.x.x, but the setup seems to work with only 10.x.x. Unsure how to pin the version as we already specify ^10.0.0 across most packages.
Update react version in mephisto-task
Hi @JackUrb , hope you are doing well.

I'm trying to run a custom react task with Mephisto which is using https://github.com/react-dnd/react-dnd/ as a depency for drag and drop feature. That package requires React version `^16.14.0`. However, mephisto-task package is fixed with React `16.13.1` and I had react version conflict when I try to npm install `react-dnd`.

Therefore, I just wonder can we update `mephisto-task` package to accept newer react versions? I'm afraid that in the future we will use other packages that require latest react versions as well. Happy to hear if we have any alternative approaches 😄.


Discussion:

Resolving patch:
diff --git a/mephisto/abstractions/architects/router/build_router.py b/mephisto/abstractions/architects/router/build_router.py
--- a/mephisto/abstractions/architects/router/build_router.py
+++ b/mephisto/abstractions/architects/router/build_router.py
@@ -22,7 +22,7 @@
 FLASK_SERVER_SOURCE_ROOT = os.path.join(ROUTER_ROOT_DIR, "flask")
 CROWD_SOURCE_PATH = "static/wrap_crowd_source.js"
 TASK_CONFIG_PATH = "static/task_config.json"
-CURR_MEPHISTO_TASK_VERSION = "2.0.3"
+CURR_MEPHISTO_TASK_VERSION = "2.0.4"
 
 
 def can_build(build_dir: str, task_run: "TaskRun") -> bool:
diff --git a/mephisto/abstractions/architects/router/flask/mephisto_flask_blueprint.py b/mephisto/abstractions/architects/router/flask/mephisto_flask_blueprint.py
--- a/mephisto/abstractions/architects/router/flask/mephisto_flask_blueprint.py
+++ b/mephisto/abstractions/architects/router/flask/mephisto_flask_blueprint.py
@@ -35,7 +35,7 @@
 
 # Constants
 
-CURR_MEPHISTO_TASK_VERSION = "2.0.3"
+CURR_MEPHISTO_TASK_VERSION = "2.0.4"
 
 PACKET_TYPE_ALIVE = "alive"
 PACKET_TYPE_SUBMIT_ONBOARDING = "submit_onboarding"


Test patch:
Repository: graphql-python/graphene-django

Issue:
Use choice keys, not descriptions, for enums
Currently, the automatically generated choices for Django fields correspond to the text labels passed in not the keys.

This is problematic because changing labels in the future would lead to all your enum values being updated. It's also contrary to what I would expect as a user.

Use choice keys, not descriptions, for enums
Currently, the automatically generated choices for Django fields correspond to the text labels passed in not the keys.

This is problematic because changing labels in the future would lead to all your enum values being updated. It's also contrary to what I would expect as a user.



Discussion:

Resolving patch:
diff --git a/graphene_django/converter.py b/graphene_django/converter.py
--- a/graphene_django/converter.py
+++ b/graphene_django/converter.py
@@ -7,6 +7,7 @@
 from graphene.types.datetime import DateTime
 from graphene.types.json import JSONString
 from graphene.utils.str_converters import to_const
+from graphql import assert_valid_name
 
 from .compat import (ArrayField, HStoreField, JSONField, RangeField,
                      RelatedObject, UUIDField)
@@ -17,7 +18,12 @@
 
 
 def convert_choice_name(name):
-    return to_const(force_text(name))
+    name = to_const(force_text(name))
+    try:
+        assert_valid_name(name)
+    except AssertionError:
+        name = "A_%s" % name
+    return name
 
 
 def get_choices(choices):
@@ -26,7 +32,7 @@ def get_choices(choices):
             for choice in get_choices(help_text):
                 yield choice
         else:
-            name = convert_choice_name(help_text)
+            name = convert_choice_name(value)
             description = help_text
             yield name, value, description
 


Test patch:
Repository: graphql-python/graphene-django

Issue:
Refreshing GraphiQL invalidates the query variables
When I enter query variables into GraphiQL

![variables-double-quotes](https://cloud.githubusercontent.com/assets/134581/19841769/6d1dae1c-9f64-11e6-9c57-e94669893700.png)

Then refresh the page, the double quotes are replaced with single quotes

![variables-single-quotes](https://cloud.githubusercontent.com/assets/134581/19841777/82a857dc-9f64-11e6-900b-56da25e7d9ea.png)

Which gives the error "Variables are invalid JSON."



Discussion:

Resolving patch:
diff --git a/graphene_django/views.py b/graphene_django/views.py
--- a/graphene_django/views.py
+++ b/graphene_django/views.py
@@ -131,7 +131,7 @@ def dispatch(self, request, *args, **kwargs):
                     request,
                     graphiql_version=self.graphiql_version,
                     query=query or '',
-                    variables=variables or '',
+                    variables=json.dumps(variables) or '',
                     operation_name=operation_name or '',
                     result=result or ''
                 )


Test patch:
Repository: graphql-python/graphene-django

Issue:
DjangoFilterConnectionField does not accept Connections as type
Standard ConnectionFields allow you to pass a custom Connection in as the type for the field. This allows for defining Connection Fields like `totalCount` etc...

DjangoFilterConnectionField does not currently support this.


Discussion:

Resolving patch:
diff --git a/graphene_django/filter/fields.py b/graphene_django/filter/fields.py
--- a/graphene_django/filter/fields.py
+++ b/graphene_django/filter/fields.py
@@ -1,6 +1,7 @@
 from functools import partial
 
 from ..fields import DjangoConnectionField
+from graphene.relay import is_node
 from .utils import get_filtering_args_from_filterset, get_filterset_class
 
 
@@ -9,9 +10,18 @@ class DjangoFilterConnectionField(DjangoConnectionField):
     def __init__(self, type, fields=None, extra_filter_meta=None,
                  filterset_class=None, *args, **kwargs):
 
-        self.fields = fields or type._meta.filter_fields
-        meta = dict(model=type._meta.model,
-                    fields=self.fields)
+        if is_node(type):
+            _fields = type._meta.filter_fields
+            _model = type._meta.model
+        else:
+            # ConnectionFields can also be passed Connections,
+            # in which case, we need to use the Node of the connection
+            # to get our relevant args.
+            _fields = type._meta.node._meta.filter_fields
+            _model = type._meta.node._meta.model
+
+        self.fields = fields or _fields
+        meta = dict(model=_model, fields=self.fields)
         if extra_filter_meta:
             meta.update(extra_filter_meta)
         self.filterset_class = get_filterset_class(filterset_class, **meta)


Test patch:
Repository: graphql-python/graphene-django

Issue:
Incorrect response format for batched queries
I've been working with `graphene-django` for the last 3 weeks, and have been implementing it with `apollo-client` on the frontend. I just switched on batched queries, and determined that `graphene-django` is trying to return a list of responses in the following format:

`
response = [
{
  id,
  payload,
  status
},
...
]
`

I can't seem to find any documentation that indicates that this should be the format for batched responses. As it is, this breaks `apollo-client`. I propose just returning a list of responses to adhere to the expected format.


Discussion:

Resolving patch:
diff --git a/graphene_django/views.py b/graphene_django/views.py
--- a/graphene_django/views.py
+++ b/graphene_django/views.py
@@ -160,11 +160,8 @@ def get_response(self, request, data, show_graphiql=False):
                 response['data'] = execution_result.data
 
             if self.batch:
-                response = {
-                    'id': id,
-                    'payload': response,
-                    'status': status_code,
-                }
+                response['id'] = id
+                response['status'] = status_code
 
             result = self.json_encode(request, response, pretty=show_graphiql)
         else:


Test patch:
diff --git a/graphene_django/tests/test_views.py b/graphene_django/tests/test_views.py
--- a/graphene_django/tests/test_views.py
+++ b/graphene_django/tests/test_views.py
@@ -178,7 +178,7 @@ def test_batch_allows_post_with_json_encoding(client):
     assert response.status_code == 200
     assert response_json(response) == [{
         'id': 1,
-        'payload': { 'data': {'test': "Hello World"} },
+        'data': {'test': "Hello World"},
         'status': 200,
     }]
 
@@ -233,7 +233,7 @@ def test_batch_supports_post_json_query_with_string_variables(client):
     assert response.status_code == 200
     assert response_json(response) == [{
         'id': 1,
-        'payload': { 'data': {'test': "Hello Dolly"} },
+        'data': {'test': "Hello Dolly"},
         'status': 200,
     }]
 
@@ -260,7 +260,7 @@ def test_batch_supports_post_json_query_with_json_variables(client):
     assert response.status_code == 200
     assert response_json(response) == [{
         'id': 1,
-        'payload': { 'data': {'test': "Hello Dolly"} },
+        'data': {'test': "Hello Dolly"},
         'status': 200,
     }]
 
@@ -356,11 +356,9 @@ def test_batch_allows_post_with_operation_name(client):
     assert response.status_code == 200
     assert response_json(response) == [{
         'id': 1,
-        'payload': {
-            'data': {
-                'test': 'Hello World',
-                'shared': 'Hello Everyone'
-            }
+        'data': {
+            'test': 'Hello World',
+            'shared': 'Hello Everyone'
         },
         'status': 200,
     }]
Repository: graphql-python/graphene-django

Issue:
Cannot import graphene_django.tests.base_test.GraphQLTestCase
when I pip install or download it directly here https://pypi.org/project/graphene-django/2.2.0/ 
base_test.py is missing.


Discussion:
@Timmerop just that one file or all tests?

Why are you looking for tests in the pip-installable version of the package?
Just the one file.
I'm trying to use `from graphene_django.tests.base_test import GraphQLTestCase` in my tests
Yes this isn't happening for me either. It looks like we have an import error! I am going to add this issue to our current project work to get it resolved with graphene-django 2.3

Resolving patch:
diff --git a/graphene_django/utils/__init__.py b/graphene_django/utils/__init__.py
new file mode 100644
--- /dev/null
+++ b/graphene_django/utils/__init__.py
@@ -0,0 +1,19 @@
+from .utils import (
+    DJANGO_FILTER_INSTALLED,
+    get_reverse_fields,
+    maybe_queryset,
+    get_model_fields,
+    is_valid_django_model,
+    import_single_dispatch,
+)
+from .testing import GraphQLTestCase
+
+__all__ = [
+    "DJANGO_FILTER_INSTALLED",
+    "get_reverse_fields",
+    "maybe_queryset",
+    "get_model_fields",
+    "is_valid_django_model",
+    "import_single_dispatch",
+    "GraphQLTestCase",
+]
diff --git a/graphene_django/utils.py b/graphene_django/utils/utils.py
similarity index 96%
rename from graphene_django/utils.py
rename to graphene_django/utils/utils.py
--- a/graphene_django/utils.py
+++ b/graphene_django/utils/utils.py
@@ -4,13 +4,6 @@
 from django.db.models.manager import Manager
 
 
-# from graphene.utils import LazyList
-
-
-class LazyList(object):
-    pass
-
-
 try:
     import django_filters  # noqa
 


Test patch:
diff --git a/docs/testing.rst b/docs/testing.rst
--- a/docs/testing.rst
+++ b/docs/testing.rst
@@ -9,7 +9,7 @@ Usage:
 
     import json
 
-    from graphene_django.tests.base_test import GraphQLTestCase
+    from graphene_django.utils.testing import GraphQLTestCase
     from my_project.config.schema import schema
 
     class MyFancyTestCase(GraphQLTestCase):
diff --git a/graphene_django/tests/base_test.py b/graphene_django/utils/testing.py
similarity index 95%
rename from graphene_django/tests/base_test.py
rename to graphene_django/utils/testing.py
--- a/graphene_django/tests/base_test.py
+++ b/graphene_django/utils/testing.py
@@ -1,8 +1,6 @@
 import json
 
-from django.http import HttpResponse
-from django.test import Client
-from django.test import TestCase
+from django.test import TestCase, Client
 
 
 class GraphQLTestCase(TestCase):
Repository: graphql-python/graphene-django

Issue:
GraphiQL to version v0.11.11?
Proposal to move to GraphiQL v0.11.11 to solve a markdown issue in the documentation:
cfr. https://github.com/graphql/graphiql/issues/575

Scanning over the code, the main difference between v0.11.10 and v0.11.11 is a switch from 'marked' to 'markdown-it' for rendering the documentation.

Affected lines:
https://github.com/graphql-python/graphene-django/blob/f76f38ef30b88d921df243b09c4970528b1a4007/graphene_django/views.py#L54


Discussion:
I don't see why we couldn't update this given that 0.11.10 came out close to 1.5 years ago. Adjusting the labels.
Adding to our current project

Resolving patch:
diff --git a/graphene_django/views.py b/graphene_django/views.py
--- a/graphene_django/views.py
+++ b/graphene_django/views.py
@@ -51,7 +51,7 @@ def instantiate_middleware(middlewares):
 
 
 class GraphQLView(View):
-    graphiql_version = "0.11.10"
+    graphiql_version = "0.11.11"
     graphiql_template = "graphene/graphiql.html"
 
     schema = None


Test patch:
Repository: graphql-python/graphene-django

Issue:
Found different types with the same name in the schema: ErrorType, ErrorType.
After updating from 2.1.3 to 2.1.6 this error shows up.
It seems that importing `ErrorType` from `graphene_django/forms/types.py` is obsolete now, as `ErrorType` now lives in `graphene_django/types.py`
This module should be removed or it just needs to import `ErrorType` from new location for backwards compatibility?


Discussion:
@defiler good find! I'll create a PR to fix this.

Resolving patch:
diff --git a/graphene_django/forms/types.py b/graphene_django/forms/types.py
--- a/graphene_django/forms/types.py
+++ b/graphene_django/forms/types.py
@@ -1,6 +1,3 @@
 import graphene
 
-
-class ErrorType(graphene.ObjectType):
-    field = graphene.String()
-    messages = graphene.List(graphene.String)
+from ..types import ErrorType  # noqa Import ErrorType for backwards compatability


Test patch:
Repository: graphql-python/graphene-django

Issue:
NormalCursorWrapper has invalid sigatures for callproc and execute
File: /debug/sql/tracking.py          

The callproc and execute methods have an incorrect signature. This is causing a substitution attempt in the standard code, which breaks if there are '%'s in the SQL function.

    def callproc(self, procname, params=()):
          return self._record(self.cursor.callproc, procname, params)
  
    def execute(self, sql, params=()):
          return self._record(self.cursor.execute, sql, params)



Discussion:

Resolving patch:
diff --git a/graphene_django/debug/sql/tracking.py b/graphene_django/debug/sql/tracking.py
--- a/graphene_django/debug/sql/tracking.py
+++ b/graphene_django/debug/sql/tracking.py
@@ -148,10 +148,10 @@ def _record(self, method, sql, params):
             # We keep `sql` to maintain backwards compatibility
             self.logger.object.sql.append(_sql)
 
-    def callproc(self, procname, params=()):
+    def callproc(self, procname, params=None):
         return self._record(self.cursor.callproc, procname, params)
 
-    def execute(self, sql, params=()):
+    def execute(self, sql, params=None):
         return self._record(self.cursor.execute, sql, params)
 
     def executemany(self, sql, param_list):


Test patch:
Repository: graphql-python/graphene-django

Issue:
Add custom header support to GraphiQL
Related issue: https://github.com/graphql/graphiql/issues/500

GraphiQL by default does not implement a way to pass custom request headers, which are still fairly commonly used for example by authentication middleware. It would be nice if graphene-django's built-in GraphiQL view had support for doing authenticated requests with custom HTTP headers.


Discussion:
Yes, without being able to customize the headers, it's not possible to test JWT authentication
This seems like a good enhancement. If anyone wants to contribute a PR for this that would be very helpful.

Resolving patch:
diff --git a/graphene_django/settings.py b/graphene_django/settings.py
--- a/graphene_django/settings.py
+++ b/graphene_django/settings.py
@@ -41,6 +41,10 @@
     "DJANGO_CHOICE_FIELD_ENUM_CUSTOM_NAME": None,
     # Use a separate path for handling subscriptions.
     "SUBSCRIPTION_PATH": None,
+    # By default GraphiQL headers editor tab is enabled, set to False to hide it
+    # This sets headerEditorEnabled GraphiQL option, for details go to
+    # https://github.com/graphql/graphiql/tree/main/packages/graphiql#options
+    "GRAPHIQL_HEADER_EDITOR_ENABLED": True,
 }
 
 if settings.DEBUG:
diff --git a/graphene_django/views.py b/graphene_django/views.py
--- a/graphene_django/views.py
+++ b/graphene_django/views.py
@@ -167,6 +167,8 @@ def dispatch(self, request, *args, **kwargs):
                     subscriptions_transport_ws_sri=self.subscriptions_transport_ws_sri,
                     # The SUBSCRIPTION_PATH setting.
                     subscription_path=self.subscription_path,
+                    # GraphiQL headers tab,
+                    graphiql_header_editor_enabled=graphene_settings.GRAPHIQL_HEADER_EDITOR_ENABLED,
                 )
 
             if self.batch:


Test patch:
Repository: graphql-python/graphene-django

Issue:
Cant export schema to stdout in graphql format
The format for the schema(json or graphql SDL) is defined by the extension of the `--out` flag. If `--out=-`(stdout), there's no way to generate a GraphQL SDL representation of the schema.


Discussion:

Resolving patch:
diff --git a/graphene_django/management/commands/graphql_schema.py b/graphene_django/management/commands/graphql_schema.py
--- a/graphene_django/management/commands/graphql_schema.py
+++ b/graphene_django/management/commands/graphql_schema.py
@@ -60,8 +60,10 @@ def save_graphql_file(self, out, schema):
 
     def get_schema(self, schema, out, indent):
         schema_dict = {"data": schema.introspect()}
-        if out == "-":
+        if out == "-" or out == "-.json":
             self.stdout.write(json.dumps(schema_dict, indent=indent, sort_keys=True))
+        elif out == "-.graphql":
+            self.stdout.write(print_schema(schema))
         else:
             # Determine format
             _, file_extension = os.path.splitext(out)


Test patch:
Repository: graphql-python/graphene-django

Issue:
Replace Unidecode package with text_unidecode package
* **What is the current behavior?**

  The Unidecode package is licensed under GPL, which makes it impossible to include it in any non-GPL/MIT licensed software. Since graphene-django is licensed under MIT, it would be great to allow graphene-django to be included in non-GPL/MIT licensed software, which is currently disallowed by the GPL of unidecode (which is the only dependency with such a problem). 

  The alternative package text_unidecode offers a drop-in replacement for unidecode with a less restrictive license. However, as stated to the project website unidecode offers better memory usage and better transliteration quality over text_unidecode. Will this be a show stopper or would it be possible to exchange the packages?

* **What is the expected behavior?**

  graphene-django should be usable within any project.

* **What is the motivation / use case for changing the behavior?**

  Allow graphene-django to be used in non-GPL/MIT licensed projects.

* **Please tell us about your environment:**
  
  - Version: 2.12.1
  - Platform: Linux

* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)



Discussion:
Replacing unidecode with text_decode is as easy as replacing the import and the test suite passes. If this is a viable solution, I would be happy to provide the PR.

However, maybe someone has a generell opinion on the license problem?

Resolving patch:
diff --git a/graphene_django/utils/str_converters.py b/graphene_django/utils/str_converters.py
--- a/graphene_django/utils/str_converters.py
+++ b/graphene_django/utils/str_converters.py
@@ -1,5 +1,5 @@
 import re
-from unidecode import unidecode
+from text_unidecode import unidecode
 
 
 def to_const(string):
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -66,7 +66,7 @@
         "Django>=1.11",
         "singledispatch>=3.4.0.3",
         "promise>=2.1",
-        "unidecode>=1.1.1,<2",
+        "text-unidecode",
     ],
     setup_requires=["pytest-runner"],
     tests_require=tests_require,


Test patch:
Repository: graphql-python/graphene-django

Issue:
Why `DjangoFormMutation.perform_mutate()` calls `form.save()`
Django's plain (non-model) `Form`s don't have the `save()` method. Why does `DjangoFormMutation.perform_mutate()` still call that here: 

https://github.com/graphql-python/graphene-django/blob/3058118e8fc64a0a0853b67364381eccc7746f67/graphene_django/forms/mutation.py#L104

Am I missing something or does this just always end up in an error?


Discussion:
You're correct. That should probably be part of the DjangoModelFormMutation instead
> You're correct. That should probably be part of the DjangoModelFormMutation instead

Yeah, it is there: https://github.com/graphql-python/graphene-django/blob/3058118e8fc64a0a0853b67364381eccc7746f67/graphene_django/forms/mutation.py#L179-L183 and I think it should only be there.

Resolving patch:
diff --git a/graphene_django/forms/mutation.py b/graphene_django/forms/mutation.py
--- a/graphene_django/forms/mutation.py
+++ b/graphene_django/forms/mutation.py
@@ -101,7 +101,10 @@ def __init_subclass_with_meta__(
 
     @classmethod
     def perform_mutate(cls, form, info):
-        form.save()
+        if hasattr(form, "save"):
+            # `save` method won't exist on plain Django forms, but this mutation can
+            # in theory be used with `ModelForm`s as well and we do want to save them.
+            form.save()
         return cls(errors=[], **form.cleaned_data)
 
 


Test patch: