Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to build rds_data #23

Closed
NyanKiyoshi opened this issue May 11, 2020 · 4 comments
Closed

[BUG] Unable to build rds_data #23

NyanKiyoshi opened this issue May 11, 2020 · 4 comments
Labels
🐞 bug Something isn't working 👋 response needed Awaiting response from a reporter

Comments

@NyanKiyoshi
Copy link

Describe the bug
Docs of mypy-boto3-rds_data says to run mypy_boto3 but outputs the following exception:

Traceback (most recent call last):
  File "/Venvs/Cloud/bin/mypy_boto3", line 11, in <module>
    load_entry_point('mypy-boto3==1.13.6.0', 'console_scripts', 'mypy_boto3')()
  File "/Venvs/Cloud/lib/python3.8/site-packages/mypy_boto3/main.py", line 131, in main
    build_package_stubs(submodule, logger)
  File "/Venvs/Cloud/lib/python3.8/site-packages/mypy_boto3/main.py", line 311, in build_package_stubs
    submodule_path / "__init__.py", _get_proxy_contents(submodule.module_name), logger,
  File "/Venvs/Cloud/lib/python3.8/site-packages/mypy_boto3/main.py", line 170, in _get_proxy_contents
    service_module = importlib.import_module(module_name)
  File "/Library/Frameworks/Python.framework/Versions/3.8/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 "/Venvs/Cloud/lib/python3.8/site-packages/mypy_boto3_rds_data/__init__.py", line 17, in <module>
    from mypy_boto3_rds_data.client import RDSDataServiceClient, RDSDataServiceClient as Client
  File "/Venvs/Cloud/lib/python3.8/site-packages/mypy_boto3_rds_data/client.py", line 17, in <module>
    from mypy_boto3_rds_data.type_defs import (
  File "/Venvs/Cloud/lib/python3.8/site-packages/mypy_boto3_rds_data/type_defs.py", line 89, in <module>
    "StructValueTypeDef", {"attributes": List[ValueTypeDef]}, total=False
NameError: name 'ValueTypeDef' is not defined

Lines 88-90 should be transformed to a lazy typing:

StructValueTypeDef = TypedDict(
-    "StructValueTypeDef", {"attributes": List[ValueTypeDef]}, total=False
+    "StructValueTypeDef", {"attributes": List["ValueTypeDef"]}, total=False
)

To Reproduce
Steps to reproduce the behavior:

  1. Install 'boto3-stubs[rds-data]'
  2. Run mypy_boto3

Additional context

> uname -rs
Darwin 19.4.0

> pip freeze | grep mypy
mypy-boto3==1.13.6.0
mypy-boto3-builder==1.0.9
mypy-boto3-cloudformation==1.13.6.0
mypy-boto3-dynamodb==1.13.6.0
mypy-boto3-ec2==1.13.6.0
mypy-boto3-lambda==1.13.6.0
mypy-boto3-rds==1.13.6.0
mypy-boto3-rds-data==1.13.6.0
mypy-boto3-s3==1.13.6.0
mypy-boto3-sqs==1.13.6.0
@vemel
Copy link
Collaborator

vemel commented Jun 6, 2020

I have never used this service. I am going to fix this issue and add a small integration test. Thank you for report.

@vemel vemel added the 🐞 bug Something isn't working label Jun 6, 2020
@vemel
Copy link
Collaborator

vemel commented Jun 6, 2020

Fixed in master, going to release

@vemel
Copy link
Collaborator

vemel commented Jun 6, 2020

Fixed in the latest version. I did not add an integration test, but tested manually. TypedDicts in type_defs.py are now sorted alphabetically for easier lookup.

Let me know if it works for you and sorry it took so long.

@vemel vemel added the 👋 response needed Awaiting response from a reporter label Jun 6, 2020
@NyanKiyoshi
Copy link
Author

Thanks! It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 👋 response needed Awaiting response from a reporter
Projects
None yet
Development

No branches or pull requests

2 participants