internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: getsentry/sentry-python

Issue:
Event is dropped if Exception occurs during `object_to_json`
This may happen if Sequence is Django queryset that has incorrect field in `filter()` expressions.


Discussion:

Resolving patch:
diff --git a/sentry_sdk/utils.py b/sentry_sdk/utils.py
--- a/sentry_sdk/utils.py
+++ b/sentry_sdk/utils.py
@@ -310,7 +310,9 @@ def safe_repr(value):
 def object_to_json(obj):
     def _walk(obj, depth):
         if depth < 4:
-            if isinstance(obj, Sequence) and not isinstance(obj, (bytes, text_type)):
+            if isinstance(obj, (list, tuple)):
+                # It is not safe to iterate over another sequence types as this may raise errors or
+                # bring undesired side-effects (e.g. Django querysets are executed during iteration)
                 return [_walk(x, depth + 1) for x in obj]
             if isinstance(obj, Mapping):
                 return {safe_str(k): _walk(v, depth + 1) for k, v in obj.items()}


Test patch:
diff --git a/tests/integrations/django/myapp/views.py b/tests/integrations/django/myapp/views.py
--- a/tests/integrations/django/myapp/views.py
+++ b/tests/integrations/django/myapp/views.py
@@ -1,7 +1,7 @@
 from django.contrib.auth import login
 from django.contrib.auth.models import User
 from django.http import HttpResponse, HttpResponseServerError, HttpResponseNotFound
-from django.shortcuts import render_to_response
+from django.shortcuts import render
 from django.views.generic import ListView
 
 import sentry_sdk
@@ -45,5 +45,5 @@ def handler404(*args, **kwargs):
     return HttpResponseNotFound("404")
 
 
-def template_exc(*args, **kwargs):
-    return render_to_response("error.html")
+def template_exc(request, *args, **kwargs):
+    return render(request, "error.html")
Repository: getsentry/sentry-python

Issue:
username and email deesn't get included even though send_default_pii=True
I am running Flask app with Flask-Login. According to https://docs.sentry.io/platforms/python/flask/:

> If you use flask-login and have set send_default_pii=True in your call to init, user data (current user id,
> email address, username) is attached to the event.

I have set send_default_pii=True. However, the event notification payload doesn't contain username and email. It contains only ID and IP Address:

```json
user: {
ip_address: "127.0.0.1",
id: "2"
}
```

UI show "?" on the "User" section implying that there could be some extra info but it appears to be static (no link, no popup):

![2019-02-13 12-13-59](https://user-images.githubusercontent.com/177266/52674667-2c31d880-2f89-11e9-8f83-348c8a902aaa.png)





Discussion:

Resolving patch:
diff --git a/sentry_sdk/integrations/flask.py b/sentry_sdk/integrations/flask.py
--- a/sentry_sdk/integrations/flask.py
+++ b/sentry_sdk/integrations/flask.py
@@ -174,3 +174,20 @@ def _add_user_to_event(event):
             # - flask_login is not configured
             # - no user is logged in
             pass
+
+        # The following attribute accesses are ineffective for the general
+        # Flask-Login case, because the User interface of Flask-Login does not
+        # care about anything but the ID. However, Flask-User (based on
+        # Flask-Login) documents a few optional extra attributes.
+        #
+        # https://github.com/lingthio/Flask-User/blob/a379fa0a281789618c484b459cb41236779b95b1/docs/source/data_models.rst#fixed-data-model-property-names
+
+        try:
+            user_info["email"] = user_info["username"] = user.email
+        except Exception:
+            pass
+
+        try:
+            user_info["username"] = user.username
+        except Exception:
+            pass


Test patch:
Repository: getsentry/sentry-python

Issue:
Unified sentry-sdk integration does not have support to add stack trace in python logger using 'stack': True in extra dict.
Migration from raven to unified sentry sdk, affected extended functionalities to python logging provided by raven. _extra_from_record - excludes keywords 'stack' and 'data'. Is there a known workaround?


Discussion:
Set `exc_info=True`, it's used for both callstack and exception stack now.

On Sat, Apr 13, 2019, 10:11 Gagan <notifications@github.com> wrote:

> Migration from raven to unified sentry sdk, affected extended
> functionalities to python logging provided by raven. _extra_from_record -
> excludes keywords 'stack' and 'data'. Is there a known workaround?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/getsentry/sentry-python/issues/336>, or mute the
> thread
> <https://github.com/notifications/unsubscribe-auth/AAGMPRI6YZ25H6YC2BI6MNDPQGITBANCNFSM4HFXVORA>
> .
>

About 'data' key in extra. It is also used for breadcrumbs, is that the reason we can't use it in python logging explicitly?
Good point, this seems like a bug. Likely a copy paste error from raven.
Would certainly appreciate a PR!

On Sat, Apr 13, 2019, 10:16 Gagan <notifications@github.com> wrote:

> About 'data' key in extra. It is also used for breadcrumbs, is that the
> reason we can't use it in python logging?
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/getsentry/sentry-python/issues/336#issuecomment-482788026>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAGMPRKGE6ULYIZI6CUGSLTPQGJENANCNFSM4HFXVORA>
> .
>


Resolving patch:
diff --git a/sentry_sdk/integrations/logging.py b/sentry_sdk/integrations/logging.py
--- a/sentry_sdk/integrations/logging.py
+++ b/sentry_sdk/integrations/logging.py
@@ -106,7 +106,6 @@ def _logging_to_event_level(levelname):
     (
         "args",
         "created",
-        "data",
         "exc_info",
         "exc_text",
         "filename",


Test patch:
Repository: getsentry/sentry-python

Issue:
0.7.10 CeleryIntegration captures task Ignore exception
Similar to #252, I've noticed that the Sentry client with the CeleryIntegration is capturing task Ignore exceptions, which are often used with dynamic tasks (see also https://github.com/celery/celery/issues/3437). I believe that since Retries are ignored, the `Ignore` exception should also be ignored.

The exception in Sentry is showing `celery/app/task.py in replace at line 894`:
```python
raise Ignore('Replaced by new task')
```

celery: 4.3
sentry-sdk: 0.7.10
python: 3.6


Discussion:

Resolving patch:
diff --git a/sentry_sdk/integrations/celery.py b/sentry_sdk/integrations/celery.py
--- a/sentry_sdk/integrations/celery.py
+++ b/sentry_sdk/integrations/celery.py
@@ -2,7 +2,12 @@
 
 import sys
 
-from celery.exceptions import SoftTimeLimitExceeded, Retry  # type: ignore
+from celery.exceptions import (  # type: ignore
+    SoftTimeLimitExceeded,
+    Retry,
+    Ignore,
+    Reject,
+)
 
 from sentry_sdk.hub import Hub
 from sentry_sdk.utils import capture_internal_exceptions, event_from_exception
@@ -11,6 +16,9 @@
 from sentry_sdk.integrations.logging import ignore_logger
 
 
+CELERY_CONTROL_FLOW_EXCEPTIONS = (Retry, Ignore, Reject)
+
+
 class CeleryIntegration(Integration):
     identifier = "celery"
 
@@ -106,7 +114,7 @@ def _capture_exception(task, exc_info):
 
     if hub.get_integration(CeleryIntegration) is None:
         return
-    if isinstance(exc_info[1], Retry):
+    if isinstance(exc_info[1], CELERY_CONTROL_FLOW_EXCEPTIONS):
         return
     if hasattr(task, "throws") and isinstance(exc_info[1], task.throws):
         return


Test patch:
Repository: getsentry/sentry-python

Issue:
should_hide_frame fails to consider __hide_traceback__ in any frame with a __name__
https://github.com/getsentry/sentry-python/blob/8b3de2c80e9c4bc23fe860855d63e6eb294e987d/sentry_sdk/utils.py#L211-L226

If `__name__` is in `frame.f_globals` and is a string, then no check for `__hide_traceback__` is ever performed, which effectively makes that variable unusable to hide a frame from a stacktrace.


Discussion:

Resolving patch:
diff --git a/sentry_sdk/utils.py b/sentry_sdk/utils.py
--- a/sentry_sdk/utils.py
+++ b/sentry_sdk/utils.py
@@ -212,7 +212,8 @@ def should_hide_frame(frame):
     # type: (Any) -> bool
     try:
         mod = frame.f_globals["__name__"]
-        return mod.startswith("sentry_sdk.")
+        if mod.startswith("sentry_sdk."):
+            return True
     except (AttributeError, KeyError):
         pass
 


Test patch:
Repository: getsentry/sentry-python

Issue:
Enforce functools.wraps on all monkeypatches
I'm using [`celery-once`](https://github.com/cameronmaske/celery-once) to make sure some tasks are only run one at a time. The lock is acquired in `apply_async` and released in `after_return`. 

When I use the `CeleryIntegration` I'm not seeing any of the locks being released after the task has finished running. I'm not very familiar with the inner workings of celery, but any ideas what's going on?



Discussion:
Do you see this bug in Raven-Python? Raven uses official Celery hooks while this SDK aggressively (for lack of a better word) monkeypatches Celery to capture exceptions happening in hooks, and to work around some bugs in Celery 3.
I think I've narrowed it down to an issue with `celery-once`. The library uses the task name and call arguments from the `run` method (using `inspect.getcallargs) to generate the lock key. It generates the key both when acquiring and releasing the lock. It seems the arguments before and after the task gets patched are slightly different (the wrapper takes in optional args).

I don't think this is strictly an issue with the SDK, so I'll close this for now, thanks for looking at it though.
@mumumumu if it's a missing functools.wraps somewhere we can fix it in the SDK as well, no big deal
Thanks @untitaker, that'd be much appreciated. Adding a `@wraps(f)` to the `_wrap_task_call` `_inner` function does fix the issue for me.
We should do this everywhere then. Monkeypatches are quite inconsistent across the codebase.

Resolving patch:
diff --git a/sentry_sdk/integrations/celery.py b/sentry_sdk/integrations/celery.py
--- a/sentry_sdk/integrations/celery.py
+++ b/sentry_sdk/integrations/celery.py
@@ -1,5 +1,6 @@
 from __future__ import absolute_import
 
+import functools
 import sys
 
 from celery.exceptions import (  # type: ignore
@@ -64,6 +65,7 @@ def sentry_build_tracer(name, task, *args, **kwargs):
 
 
 def _wrap_apply_async(task, f):
+    @functools.wraps(f)
     def apply_async(*args, **kwargs):
         hub = Hub.current
         integration = hub.get_integration(CeleryIntegration)
@@ -87,6 +89,7 @@ def _wrap_tracer(task, f):
     # This is the reason we don't use signals for hooking in the first place.
     # Also because in Celery 3, signal dispatch returns early if one handler
     # crashes.
+    @functools.wraps(f)
     def _inner(*args, **kwargs):
         hub = Hub.current
         if hub.get_integration(CeleryIntegration) is None:
@@ -114,6 +117,11 @@ def _inner(*args, **kwargs):
 def _wrap_task_call(task, f):
     # Need to wrap task call because the exception is caught before we get to
     # see it. Also celery's reported stacktrace is untrustworthy.
+
+    # functools.wraps is important here because celery-once looks at this
+    # method's name.
+    # https://github.com/getsentry/sentry-python/issues/421
+    @functools.wraps(f)
     def _inner(*args, **kwargs):
         try:
             return f(*args, **kwargs)


Test patch:
Repository: getsentry/sentry-python

Issue:
logging breadcrumb collection time is incorrect

![sentry](https://user-images.githubusercontent.com/28345280/61774444-71f0a800-ae29-11e9-8074-f3c88154b432.png)

I found the breadcrumbs timestamp converted to the local time zone
datetime.datetime.fromtimestamp(record.created)

> ```python
> # /sentry_sdk/integrations/logging.py:90
> def _breadcrumb_from_record(record):
>     # type: (LogRecord) -> Dict[str, Any]
>     return {
>         "ty": "log",
>         "level": _logging_to_event_level(record.levelname),
>         "category": record.name,
>         "message": record.message,
>         "timestamp": datetime.datetime.fromtimestamp(record.created),
>         "data": _extra_from_record(record),
>     }
> ```


Discussion:
Thanks, yes this is a bug. Will fix this week!

Resolving patch:
diff --git a/sentry_sdk/integrations/logging.py b/sentry_sdk/integrations/logging.py
--- a/sentry_sdk/integrations/logging.py
+++ b/sentry_sdk/integrations/logging.py
@@ -96,7 +96,7 @@ def _breadcrumb_from_record(record):
         "level": _logging_to_event_level(record.levelname),
         "category": record.name,
         "message": record.message,
-        "timestamp": datetime.datetime.fromtimestamp(record.created),
+        "timestamp": datetime.datetime.utcfromtimestamp(record.created),
         "data": _extra_from_record(record),
     }
 


Test patch:
Repository: getsentry/sentry-python

Issue:
AssertionError Need to set transaction when entering span!
After upgrading from sentry-sdk 0.10.2 to sentry-sdk-0.11.0 I received many errors with next text:
```
AssertionError
Need to set transaction when entering span!
```
Sometimes some requests leads to that error, but after repeating the same ones they work without error

asgiref                  3.1.2
channels                 2.2.0     
channels-redis           2.4.0
Django                   2.2.4
djangorestframework      3.9.1
psycopg2-binary          2.8.3
redis                    2.10.6



Discussion:
Hi, are you using the ASGI Middleware of the Sentry sdk?

On Sun, Aug 18, 2019, 02:51 Konstantin Nesterenko <notifications@github.com>
wrote:

> After upgrading from sentry-sdk 0.10.2 to sentry-sdk-0.11.0 I received
> many errors with next text:
>
> AssertionError
> Need to set transaction when entering span!
>
> Sometimes some requests leads to that error, but after repeating the same
> ones they work without error
>
> asgiref 3.1.2
> channels 2.2.0
> channels-redis 2.4.0
> Django 2.2.4
> psycopg2-binary 2.8.3
> redis 2.10.6
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/getsentry/sentry-python/issues/472?email_source=notifications&email_token=AAGMPRPQRFGOXZMBKZ56BL3QFCMINA5CNFSM4IMQ2CZ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HFZ2MSQ>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAGMPRMTEEZW4SGV4ZTUH2LQFCMINANCNFSM4IMQ2CZQ>
> .
>


Resolving patch:
diff --git a/sentry_sdk/tracing.py b/sentry_sdk/tracing.py
--- a/sentry_sdk/tracing.py
+++ b/sentry_sdk/tracing.py
@@ -5,7 +5,7 @@
 from datetime import datetime
 
 import sentry_sdk
-from sentry_sdk.utils import capture_internal_exceptions
+from sentry_sdk.utils import capture_internal_exceptions, logger
 from sentry_sdk._compat import PY2
 from sentry_sdk._types import MYPY
 
@@ -272,9 +272,9 @@ def finish(self, hub=None):
             # resolved to a concrete decision. If `sampled` is `None`, it's
             # likely that somebody used `with sentry_sdk.Hub.start_span(..)` on a
             # non-transaction span and later decided to make it a transaction.
-            assert (
-                self.sampled is not None
-            ), "Need to set transaction when entering span!"
+            if self.sampled is None:
+                logger.warning("Discarding transaction Span without sampling decision")
+
             return None
 
         return hub.capture_event(


Test patch:
Repository: getsentry/sentry-python

Issue:
DeprecationWarning in sqlalchemy integration
At integrations/sqlalchemy.py line 28 - integration is listening for dbapi_error, this was deprecated in sqlalchemy a long time ago and should be replaced with handle_error event


Discussion:

Resolving patch:
diff --git a/sentry_sdk/integrations/sqlalchemy.py b/sentry_sdk/integrations/sqlalchemy.py
--- a/sentry_sdk/integrations/sqlalchemy.py
+++ b/sentry_sdk/integrations/sqlalchemy.py
@@ -25,7 +25,7 @@ def setup_once():
 
         listen(Engine, "before_cursor_execute", _before_cursor_execute)
         listen(Engine, "after_cursor_execute", _after_cursor_execute)
-        listen(Engine, "dbapi_error", _dbapi_error)
+        listen(Engine, "handle_error", _handle_error)
 
 
 def _before_cursor_execute(
@@ -63,8 +63,9 @@ def _after_cursor_execute(conn, cursor, statement, *args):
         ctx_mgr.__exit__(None, None, None)
 
 
-def _dbapi_error(conn, *args):
+def _handle_error(context, *args):
     # type: (Any, *Any) -> None
+    conn = context.connection
     span = getattr(conn, "_sentry_sql_span", None)  # type: Optional[Span]
 
     if span is not None:


Test patch:
Repository: getsentry/sentry-python

Issue:
Problem with typing
Some error is occurring with sentry for python (using python 3.8)

```
[ERROR] AttributeError: type object 'Callable' has no attribute '_abc_registry'
Traceback (most recent call last):
  File "/var/task/handler.py", line 609, in lambda_handler
    return LambdaHandler.lambda_handler(event, context)
  File "/var/task/handler.py", line 240, in lambda_handler
    handler = cls()
  File "/var/task/handler.py", line 134, in __init__
    self.app_module = importlib.import_module(self.settings.APP_MODULE)
  File "/var/lang/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/task/src/main.py", line 6, in <module>
    import sentry_sdk
  File "/var/task/sentry_sdk/__init__.py", line 1, in <module>
    from sentry_sdk.hub import Hub, init
  File "/var/task/sentry_sdk/hub.py", line 8, in <module>
    from sentry_sdk._compat import with_metaclass
  File "/var/task/sentry_sdk/_compat.py", line 3, in <module>
    from sentry_sdk._types import MYPY
  File "/var/task/sentry_sdk/_types.py", line 2, in <module>
    from typing import TYPE_CHECKING as MYPY
  File "/var/task/typing.py", line 1357, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/var/task/typing.py", line 1005, in __new__
    self._abc_registry = extra._abc_registry

```
Any hint?


Discussion:
I think you should be able to reproduce this by running `import typing` in a REPL, so I don't think this is Sentry-related.

Resolving patch:
diff --git a/sentry_sdk/api.py b/sentry_sdk/api.py
--- a/sentry_sdk/api.py
+++ b/sentry_sdk/api.py
@@ -14,8 +14,9 @@
     from typing import Callable
     from typing import TypeVar
     from typing import ContextManager
+    from typing import Union
 
-    from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint
+    from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint, ExcInfo
     from sentry_sdk.tracing import Span
 
     T = TypeVar("T")
@@ -93,7 +94,7 @@ def capture_message(
 
 @hubmethod
 def capture_exception(
-    error=None,  # type: Optional[BaseException]
+    error=None,  # type: Optional[Union[BaseException, ExcInfo]]
     scope=None,  # type: Optional[Any]
     **scope_args  # type: Dict[str, Any]
 ):


Test patch:
Repository: getsentry/sentry-python

Issue:
Sets are not breadth-limited
I've got huge repr-s of sets that are included in the stack trace variables without truncation. As I see in `serializer.py`, `Mapping` and `Sequence` are limited to 10 items, but `typing.Set` is not handled yet.

![image](https://user-images.githubusercontent.com/2793551/90019532-d5f14300-dcae-11ea-9011-2d7e6a13d477.png)




Discussion:

Resolving patch:
diff --git a/sentry_sdk/serializer.py b/sentry_sdk/serializer.py
--- a/sentry_sdk/serializer.py
+++ b/sentry_sdk/serializer.py
@@ -36,14 +36,14 @@
 if PY2:
     # Importing ABCs from collections is deprecated, and will stop working in 3.8
     # https://github.com/python/cpython/blob/master/Lib/collections/__init__.py#L49
-    from collections import Mapping, Sequence
+    from collections import Mapping, Sequence, Set
 
     serializable_str_types = string_types
 
 else:
     # New in 3.3
     # https://docs.python.org/3/library/collections.abc.html
-    from collections.abc import Mapping, Sequence
+    from collections.abc import Mapping, Sequence, Set
 
     # Bytes are technically not strings in Python 3, but we can serialize them
     serializable_str_types = (str, bytes)
@@ -291,7 +291,9 @@ def _serialize_node_impl(
 
             return rv_dict
 
-        elif not isinstance(obj, serializable_str_types) and isinstance(obj, Sequence):
+        elif not isinstance(obj, serializable_str_types) and isinstance(
+            obj, (Set, Sequence)
+        ):
             rv_list = []
 
             for i, v in enumerate(obj):


Test patch:
diff --git a/tests/test_serializer.py b/tests/test_serializer.py
--- a/tests/test_serializer.py
+++ b/tests/test_serializer.py
@@ -55,6 +55,19 @@ def inner(message, **kwargs):
     return inner
 
 
+@pytest.fixture
+def extra_normalizer(relay_normalize):
+    if relay_normalize({"test": "test"}) is None:
+        pytest.skip("no relay available")
+
+    def inner(message, **kwargs):
+        event = serialize({"extra": {"foo": message}}, **kwargs)
+        normalized = relay_normalize(event)
+        return normalized["extra"]["foo"]
+
+    return inner
+
+
 def test_bytes_serialization_decode(message_normalizer):
     binary = b"abc123\x80\xf0\x9f\x8d\x95"
     result = message_normalizer(binary, should_repr_strings=False)
@@ -66,3 +79,8 @@ def test_bytes_serialization_repr(message_normalizer):
     binary = b"abc123\x80\xf0\x9f\x8d\x95"
     result = message_normalizer(binary, should_repr_strings=True)
     assert result == r"b'abc123\x80\xf0\x9f\x8d\x95'"
+
+
+def test_serialize_sets(extra_normalizer):
+    result = extra_normalizer({1, 2, 3})
+    assert result == [1, 2, 3]
Repository: getsentry/sentry-python

Issue:
GcpIntegration' object has no attribute 'timeout_warning'



Discussion:

Resolving patch:
diff --git a/sentry_sdk/integrations/aws_lambda.py b/sentry_sdk/integrations/aws_lambda.py
--- a/sentry_sdk/integrations/aws_lambda.py
+++ b/sentry_sdk/integrations/aws_lambda.py
@@ -237,7 +237,7 @@ def inner(*args, **kwargs):
 
 def _make_request_event_processor(aws_event, aws_context, configured_timeout):
     # type: (Any, Any, Any) -> EventProcessor
-    start_time = datetime.now()
+    start_time = datetime.utcnow()
 
     def event_processor(event, hint, start_time=start_time):
         # type: (Event, Hint, datetime) -> Optional[Event]
@@ -318,7 +318,7 @@ def _get_cloudwatch_logs_url(context, start_time):
     Returns:
         str -- AWS Console URL to logs.
     """
-    formatstring = "%Y-%m-%dT%H:%M:%S"
+    formatstring = "%Y-%m-%dT%H:%M:%SZ"
 
     url = (
         "https://console.aws.amazon.com/cloudwatch/home?region={region}"
@@ -329,7 +329,7 @@ def _get_cloudwatch_logs_url(context, start_time):
         log_group=context.log_group_name,
         log_stream=context.log_stream_name,
         start_time=(start_time - timedelta(seconds=1)).strftime(formatstring),
-        end_time=(datetime.now() + timedelta(seconds=2)).strftime(formatstring),
+        end_time=(datetime.utcnow() + timedelta(seconds=2)).strftime(formatstring),
     )
 
     return url
diff --git a/sentry_sdk/integrations/gcp.py b/sentry_sdk/integrations/gcp.py
--- a/sentry_sdk/integrations/gcp.py
+++ b/sentry_sdk/integrations/gcp.py
@@ -91,6 +91,10 @@ def sentry_func(*args, **kwargs):
 class GcpIntegration(Integration):
     identifier = "gcp"
 
+    def __init__(self, timeout_warning=False):
+        # type: (bool) -> None
+        self.timeout_warning = timeout_warning
+
     @staticmethod
     def setup_once():
         # type: () -> None


Test patch: