fireblocks / fireblocks-sdk-py

Official Python SDK for Fireblocks API
http://docs.fireblocks.com/api/swagger-ui/
MIT License
51 stars 40 forks source link

Literal type `dict[str, FieldMetadata]` breaks on Python <= 3.8 #154

Closed aarora08 closed 7 months ago

aarora08 commented 7 months ago

Describe the bug The ContractUploadRequest class uses a literal dict to type hints the input_fields_metadata parameter. Literal type hints are supported from Python 3.9 onward.

To Reproduce Steps to reproduce the behavior:

  1. Setup Python 3.8 or lower environment
  2. import fireblocks_sdk
  3. See an error as
    input_fields_metadata: Optional[dict[str, FieldMetadata]] = None,
    TypeError: 'type' object is not subscriptable

Expected behavior Able to import fireblocks_sdk on Python >= 3.6

Versions (please complete the following information):

Additional context The bug was introduced in PR fireblocks/fireblocks-sdk-py#146

YoavBZ commented 7 months ago

Thanks @aarora08 for raising this issue! We've released a fix in v2.2.2