nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: GoogleCloudPlatform/functions-framework-python
Pull request #173 (2021-12-08 17:31:34)

fix: Change gunicorn request line limit to unlimited


Patch:
diff --git a/src/functions_framework/_http/gunicorn.py b/src/functions_framework/_http/gunicorn.py
index 4871428..25fdb79 100644
--- a/src/functions_framework/_http/gunicorn.py
+++ b/src/functions_framework/_http/gunicorn.py
@@ -23,6 +23,7 @@ class GunicornApplication(gunicorn.app.base.BaseApplication):
             "threads": 8,
             "timeout": 0,
             "loglevel": "error",
+            "limit_request_line": 0,
         }
         self.options.update(options)
         self.app = app


Test patch:
diff --git a/tests/test_http.py b/tests/test_http.py
index e45dbab..bd301c9 100644
--- a/tests/test_http.py
+++ b/tests/test_http.py
@@ -100,6 +100,7 @@ def test_gunicorn_application(debug):
         "threads": 8,
         "timeout": 0,
         "loglevel": "error",
+        "limit_request_line": 0,
     }
 
     assert gunicorn_app.cfg.bind == ["1.2.3.4:1234"]
Repository: GoogleCloudPlatform/functions-framework-python
Pull request #179 (2022-03-24 11:11:57)

fix: Add functools.wraps decorator
To make sure function attributes are copied to `_http_view_func_wrapper`

<!--

Before submitting a pull request:

Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.

Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.

-->


anniefu: It seems the unit test failures are related to this PR, though it's unclear to me why the change is causing cloudevent functions to fail...
svleeuwen: @anniefu that test is also failing in master, so it's indeed not caused by this change.
anniefu: Hmm, it seems one of our dependency libraries has changed their error message causing an assertion to fail. I'll take a pass at fixing it up. Thanks for your patience.
anniefu: Hey @svleeuwen, I've fixed the tests up and rebased the PR. Do you have the ability to merge this? I can do it otherwise. Thanks again for the contribution!

Patch:
diff --git a/src/functions_framework/__init__.py b/src/functions_framework/__init__.py
index 46c8882..5d18d2a 100644
--- a/src/functions_framework/__init__.py
+++ b/src/functions_framework/__init__.py
@@ -95,6 +95,7 @@ def setup_logging():
 
 
 def _http_view_func_wrapper(function, request):
+    @functools.wraps(function)
     def view_func(path):
         return function(request._get_current_object())
 


Test patch:
diff --git a/tests/test_view_functions.py b/tests/test_view_functions.py
index 8de543d..f69b215 100644
--- a/tests/test_view_functions.py
+++ b/tests/test_view_functions.py
@@ -33,6 +33,17 @@ def test_http_view_func_wrapper():
     assert function.calls == [pretend.call(request_object)]
 
 
+def test_http_view_func_wrapper_attribute_copied():
+    def function(_):
+        pass
+
+    function.attribute = "foo"
+    view_func = functions_framework._http_view_func_wrapper(function, pretend.stub())
+
+    assert view_func.__name__ == "function"
+    assert view_func.attribute == "foo"
+
+
 def test_event_view_func_wrapper(monkeypatch):
     data = pretend.stub()
     json = {