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

Indentation errors in generated Python client #1996

Closed
mikekistler opened this issue Nov 25, 2022 · 0 comments · Fixed by #2003
Closed

Indentation errors in generated Python client #1996

mikekistler opened this issue Nov 25, 2022 · 0 comments · Fixed by #2003
Assignees
Labels
Python type:bug A broken experience

Comments

@mikekistler
Copy link
Member

I'm trying out Kiota to generate a Python client for an Azure service, Azure Load Test. I've built Kiota from source (main branch, HEAD is 2f36c65), and then generated mostly following the directions here.

But Python throws an IndentationError when I try to import the generated client:

>>> from client.load_test_client import LoadTestClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mikekistler/Projects/mikekistler/kiota/bug/client/load_test_client.py", line 22
    """
    ^
IndentationError: expected an indented block after class definition on line 21

And load_test_client.py is not the only file with indentation errors ... there are a bunch:

>find client -name '*.py' | xargs grep '^"""'
client/load_test_client.py:"""
client/load_test_client.py:"""
client/testruns/sort_and_filter/sort_and_filter_request_builder.py:"""
client/testruns/sort_and_filter/sort_and_filter_request_builder.py:"""
client/testruns/testruns_request_builder.py:"""
client/testruns/testruns_request_builder.py:"""
client/testruns/with_test_run_id_stop/with_test_run_id_stop_request_builder.py:"""
client/testruns/with_test_run_id_stop/with_test_run_id_stop_request_builder.py:"""
client/testruns/item/client_metrics/client_metrics_request_builder.py:"""
client/testruns/item/client_metrics/client_metrics_request_builder.py:"""
client/testruns/item/files/files_request_builder.py:"""
client/testruns/item/files/files_request_builder.py:"""
client/testruns/item/files/item/with_file_item_request_builder.py:"""
client/testruns/item/files/item/with_file_item_request_builder.py:"""
client/testruns/item/with_test_run_item_request_builder.py:"""
client/testruns/item/with_test_run_item_request_builder.py:"""
client/testruns/item/client_metrics_filters/client_metrics_filters_request_builder.py:"""
client/testruns/item/client_metrics_filters/client_metrics_filters_request_builder.py:"""
client/models/app_components_map.py:"""
client/models/app_components_map.py:"""
client/models/test_run_model_environment_variables.py:"""
client/models/test_run_model_environment_variables.py:"""

<and many more>

Here's how I built the client:

curl -O https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/loadtestservice/data-plane/Microsoft.LoadTestService/preview/2022-06-01-preview/loadtestservice.json

kiota generate --language python --openapi loadtestservice.json --class-name LoadTestClient --namespace-name LoadTesting --output ./client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python type:bug A broken experience
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants