← All tasks
pythonsupabase/supabase-py #33Not a task: already works

[ERROR] AttributeError: module 'typing' has no attribute '_ClassVar', supabase-py on AWS Lambda

envgap__supabase__supabase-py-33

01 / FAILURE SIGNATURE

As reported upstream

[ERROR] AttributeError: module 'typing' has no attribute '_ClassVar'
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
202c070a94a4028c43eab0b3dcfb19a363dc92ae
Manifest
pyproject.toml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

supabase/supabase-py #33 · read the original issue
AWS Lambda returns the error below when importing `supabase-py`. 



The error appears on runtimes: python 3.7 and 3.8.



 Possibly related to the typing module as one of its dependencies. 



[Issues with typing Python-3 & AWS Lambda](https://www.fernandomc.com/posts/issues-with-typing-python-3/)



# Bug report



```

[ERROR] AttributeError: module 'typing' has no attribute '_ClassVar'

Traceback (most recent call last):

  File "/var/task/serverless_sdk/__init__.py", line 144, in wrapped_handler

    return user_handler(event, context)

  File "/var/task/s_task.py", line 25, in error_handler

    raise e

  File "/var/task/s_task.py", line 20, in <module>

    user_handler = serverless_sdk.get_user_handler('index.handler')

  File "/var/task/serverless_sdk/__init__.py", line 56, in get_user_handler

    user_module = import_module(user_module_name)

  File "/var/lang/lib/python3.7/importlib/__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 728, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "/var/task/index.py", line 8, in <module>

    from supabase_py import Client, create_client

  File "/var/task/supabase_py/__init__.py", line 2, in <module>

    from . import lib

  File "/var/task/supabase_py/lib/__init__.py", line 2, in <module>

    from . import query_builder

  File "/var/task/supabase_py/lib/query_builder.py", line 8, in <module>

    from .realtime_client import SupabaseRealtimeClient

  File "/var/task/supabase_py/lib/realtime_client.py", line 3, in <module>

    from realtime_py.connection import Socket

  File "/var/task/realtime_py/__init__.py", line 2, in <module>

    from realtime_py.connection import Socket

  File "/var/task/realtime_py/connection.py", line 11, in <module>

    from realtime_py.message import HEARTBEAT_PAYLOAD, PHOENIX_CHANNEL, ChannelEvents, Message

  File "/var/task/realtime_py/message.py", line 5, in <module>

    @dataclass

  File "/var/task/dataclasses.py", line 958, in dataclass

    return wrap(_cls)

  File "/var/task/dataclasses.py", line 950, in wrap

    return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)

  File "/var/task/dataclasses.py", line 801, in _process_class

    for name, type in cls_annotations.items()]

  File "/var/task/dataclasses.py", line 801, in <listcomp>

    for name, type in cls_annotations.items()]

  File "/var/task/dataclasses.py", line 659, in _get_field

    if (_is_classvar(a_type, typing)

  File "/var/task/dataclasses.py", line 550, in _is_classvar

    return type(a_type) is typing._ClassVar

```

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]