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

ImportError: cannot import name 'build_import_method_request' #36416

Closed
jeremycline opened this issue Jul 10, 2024 · 5 comments
Closed

ImportError: cannot import name 'build_import_method_request' #36416

jeremycline opened this issue Jul 10, 2024 · 5 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team. SQL

Comments

@jeremycline
Copy link
Member

  • Package Name: azure-mgmt-sql
  • Package Version: 4.0.0b17
  • Operating System: Linux
  • Python Version: 3.12

Describe the bug
Version 4.0.0b17 includes an import for a function that doesn't exist.

To Reproduce
Steps to reproduce the behavior:

  1. pip install azure-mgmt-sql==4.0.0b17
  2. python -c 'from azure.mgmt.sql.aio import operations'
❯ python -c 'from azure.mgmt.sql.aio import operations'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jcline/.virtualenvs/az-sql/lib64/python3.12/site-packages/azure/mgmt/sql/aio/__init__.py", line 9, in <module>
    from ._sql_management_client import SqlManagementClient
  File "/home/jcline/.virtualenvs/az-sql/lib64/python3.12/site-packages/azure/mgmt/sql/aio/_sql_management_client.py", line 20, in <module>
    from .operations import (
  File "/home/jcline/.virtualenvs/az-sql/lib64/python3.12/site-packages/azure/mgmt/sql/aio/operations/__init__.py", line 12, in <module>
    from ._databases_operations import DatabasesOperations
  File "/home/jcline/.virtualenvs/az-sql/lib64/python3.12/site-packages/azure/mgmt/sql/aio/operations/_databases_operations.py", line 33, in <module>
    from ...operations._databases_operations import (
ImportError: cannot import name 'build_import_method_request' from 'azure.mgmt.sql.operations._databases_operations' (/home/jcline/.virtualenvs/az-sql/lib64/python3.12/site-packages/azure/mgmt/sql/operations/_databases_operations.py). Did you mean: 'build_import_request'?

Expected behavior
It doesn't crash.

Screenshots

Additional context
I hit this when attempting to update the azure-cli in Fedora which requires this version of azure-mgmt-sql. As part of the standard build check it attempts to import all the public modules in the package, which found this particular issue. I'd recommend introducing a similar check to your CI so you catch this sort of thing before publishing. The script used in Fedora is here: https://src.fedoraproject.org/rpms/python-rpm-macros/blob/rawhide/f/import_all_modules.py

@github-actions github-actions bot added Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team. SQL labels Jul 10, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureSQLGitHub.

@mccoyp
Copy link
Member

mccoyp commented Jul 10, 2024

Hi @jeremycline, thank you for reporting this issue. I'll tag the appropriate folks to look into fixing this.

@mccoyp mccoyp added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 10, 2024
@msyyc
Copy link
Member

msyyc commented Jul 11, 2024

Hi, we will take an investigation soon.

@msyyc
Copy link
Member

msyyc commented Jul 16, 2024

Hi @jeremycline Please help try latest version https://pypi.org/project/azure-mgmt-sql/4.0.0b18/

@jeremycline
Copy link
Member Author

Works for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team. SQL
Projects
None yet
Development

No branches or pull requests

3 participants