Skip to content

Stopped working after 0.10.2 #479

Closed
@chamini2

Description

@chamini2

Describe the bug
After the version 0.10.2 (inlcuding that one), I cannot generate the python client.

To Reproduce
Steps to reproduce the behavior:

$ pipx run --spec openapi-python-client==0.10.1 openapi-python-client generate --path target/openapi.json

Generating open-api-definition-client
Warning(s) encountered while generating. Client was generated, but some pieces may be missing

WARNING parsing PUT /feature-groups/schedule/offline-to-online-etl/bigquery-firestore within feature_group_load_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Schema(title=None, multipleOf=None, maximum=None, exclusiveMaximum=None, minimum=None, exclusiveMinimum=None, maxLength=None, minLength=None, pattern=None, maxItems=None, minItems=None, uniqueItems=None, maxProperties=None, minProperties=None, required=None, enum=None, type='array', allOf=None, oneOf=[], anyOf=[], schema_not=None, items=Reference(ref='#/components/schemas/FeatureGroupLoad'), properties=None, additionalProperties=None, description=None, schema_format=None, default=None, nullable=False, discriminator=None, readOnly=None, writeOnly=None, xml=None, externalDocs=None, example=None, deprecated=None), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing GET /feature-groups/{featureGroup}/load within feature_group_load_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/FeatureGroupLoad'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing GET /service-account/notebook-role/status within service_account_status_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'text/plain': MediaType(media_type_schema=Schema(title=None, multipleOf=None, maximum=None, exclusiveMaximum=None, minimum=None, exclusiveMinimum=None, maxLength=None, minLength=None, pattern=None, maxItems=None, minItems=None, uniqueItems=None, maxProperties=None, minProperties=None, required=None, enum=None, type='string', allOf=None, oneOf=[], anyOf=[], schema_not=None, items=None, properties=None, additionalProperties=None, description=None, schema_format=None, default=None, nullable=False, discriminator=None, readOnly=None, writeOnly=None, xml=None, externalDocs=None, example=None, deprecated=None), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing GET /service-account/api-client-role/status within service_account_status_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'text/plain': MediaType(media_type_schema=Schema(title=None, multipleOf=None, maximum=None, exclusiveMaximum=None, minimum=None, exclusiveMinimum=None, maxLength=None, minLength=None, pattern=None, maxItems=None, minItems=None, uniqueItems=None, maxProperties=None, minProperties=None, required=None, enum=None, type='string', allOf=None, oneOf=[], anyOf=[], schema_not=None, items=None, properties=None, additionalProperties=None, description=None, schema_format=None, default=None, nullable=False, discriminator=None, readOnly=None, writeOnly=None, xml=None, externalDocs=None, example=None, deprecated=None), example=None, examples=None, encoding=None)}, links=None)

vs

pipx run --spec openapi-python-client==0.10.2 openapi-python-client generate --path target/openapi.json
Generating open-api-definition-client
Traceback (most recent call last):
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/bin/openapi-python-client", line 8, in <module>
    sys.exit(app())
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/typer/main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/openapi_python_client/cli.py", line 142, in generate
    errors = create_new_client(
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/openapi_python_client/__init__.py", line 322, in create_new_client
    return project.build()
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/openapi_python_client/__init__.py", line 113, in build
    self._reformat()
  File "/Users/matteo/.local/pipx/.cache/6d25871679c6797/lib/python3.9/site-packages/openapi_python_client/__init__.py", line 130, in _reformat
    subprocess.run(
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'autoflake -i -r --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports .' returned non-zero exit status 127.

Expected behavior
That it generates the client

OpenAPI Spec File

{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"paths":{"/feature-groups/schedule/offline-to-online-etl/bigquery-firestore":{"put":{"tags":["feature-group-load-controller"],"operationId":"bigQueryToFirestoreEtlList","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeatureGroupLoad"}}}}}}}},"/feature-groups/config":{"get":{"tags":["feature-group-controller"],"operationId":"getConfig","responses":{"200":{"description":"OK","content":{"application/x-yaml":{"schema":{"$ref":"#/components/schemas/FeatureConfig"}},"application/json":{"schema":{"$ref":"#/components/schemas/FeatureConfig"}}}}}},"put":{"tags":["feature-group-controller"],"operationId":"createConfig","parameters":[{"name":"apply","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"requestBody":{"content":{"application/x-yaml":{"schema":{"$ref":"#/components/schemas/FeatureConfig"}},"application/json":{"schema":{"$ref":"#/components/schemas/FeatureConfig"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/x-yaml":{"schema":{"$ref":"#/components/schemas/FeatureConfig"}},"application/json":{"schema":{"$ref":"#/components/schemas/FeatureConfig"}}}}}}},"/datasets/config":{"get":{"tags":["dataset-controller"],"operationId":"getConfig_1","responses":{"200":{"description":"OK","content":{"application/x-yaml":{"schema":{"$ref":"#/components/schemas/DatasetConfig"}},"application/json":{"schema":{"$ref":"#/components/schemas/DatasetConfig"}}}}}},"put":{"tags":["dataset-controller"],"operationId":"createConfig_1","parameters":[{"name":"apply","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"requestBody":{"content":{"application/x-yaml":{"schema":{"$ref":"#/components/schemas/DatasetConfig"}},"application/json":{"schema":{"$ref":"#/components/schemas/DatasetConfig"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/x-yaml":{"schema":{"$ref":"#/components/schemas/DatasetConfig"}},"application/json":{"schema":{"$ref":"#/components/schemas/DatasetConfig"}}}}}}},"/datasets/{dataset}/data-frames":{"get":{"tags":["data-frame-controller"],"operationId":"getDataFramesPaged","parameters":[{"name":"dataset","in":"path","required":true,"schema":{"type":"string"}},{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDataFrame"}}}}}},"post":{"tags":["data-frame-controller"],"operationId":"createDataFrame","parameters":[{"name":"dataset","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFrame"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFrame"}}}}}}},"/service-account/notebook-role/status":{"get":{"tags":["service-account-status-controller"],"operationId":"getNotebookRoleStatus","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/service-account/api-client-role/status":{"get":{"tags":["service-account-status-controller"],"operationId":"getApiRoleStatus","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/feature-groups":{"get":{"tags":["feature-group-controller"],"operationId":"getFeatures","parameters":[{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageFeatureGroup"}}}}}}},"/feature-groups/{featureGroup}/load":{"get":{"tags":["feature-group-load-controller"],"operationId":"getLoad","parameters":[{"name":"featureGroup","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/FeatureGroupLoad"}}}}}}},"/data-frames/{dataFrame}":{"get":{"tags":["data-frame-controller"],"operationId":"getDataFrame","parameters":[{"name":"dataFrame","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFrame"}}}}}}}},"components":{"schemas":{"FeatureGroupLoad":{"type":"object","properties":{"feature_group_name":{"type":"string"},"run_status":{"$ref":"#/components/schemas/RunStatusFirestoreCollectionReference"}}},"FirestoreCollectionReference":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/StoreField"}},"store_name":{"type":"string"},"entity_id_field":{"$ref":"#/components/schemas/StoreField"},"timestamp_field":{"$ref":"#/components/schemas/StoreField"},"store_type":{"type":"string","readOnly":true,"enum":["BIGQUERY","FIRESTORE"]}}},"RunStatusFirestoreCollectionReference":{"required":["status"],"type":"object","properties":{"runId":{"type":"string","writeOnly":true},"status":{"type":"string","enum":["PENDING","RUNNING","FAILED","DONE"]},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"detail":{"type":"string"},"store_reference":{"$ref":"#/components/schemas/FirestoreCollectionReference"},"table_location":{"$ref":"#/components/schemas/TableLocation"}}},"StoreField":{"type":"object","properties":{"feature_group_name":{"type":"string"},"feature_name":{"type":"string"},"feature_path":{"type":"string"}}},"TableLocation":{"type":"object","properties":{"version":{"type":"string"},"source_type":{"type":"string","enum":["BIGQUERY","FIRESTORE"]},"table":{"type":"string"}}},"FeatureConfig":{"required":["feature_groups"],"type":"object","properties":{"feature_groups":{"type":"array","items":{"$ref":"#/components/schemas/FeatureGroup"}}}},"FeatureField":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}}},"FeatureGroup":{"required":["entity","entity_field","features","name","owner","query","source","timestamp_field"],"type":"object","properties":{"name":{"pattern":"^[a-zA-Z][a-zA-Z0-9_]{2,63}$","type":"string"},"owner":{"type":"string"},"description":{"type":"string"},"entity":{"type":"string"},"entity_field":{"type":"string"},"timestamp_field":{"type":"string"},"source":{"$ref":"#/components/schemas/Source"},"query":{"type":"string"},"features":{"type":"array","items":{"$ref":"#/components/schemas/FeatureField"}}}},"Source":{"required":["type"],"type":"object","properties":{"type":{"type":"string","enum":["BIGQUERY","DATAFLOW"]},"opts":{"$ref":"#/components/schemas/SourceOpts"}}},"SourceOpts":{"required":["entity_field","table","timestamp_field"],"type":"object","properties":{"table":{"type":"string"},"entity_field":{"type":"string"},"timestamp_field":{"type":"string"}}},"Dataset":{"required":["feature_groups","name","owner"],"type":"object","properties":{"name":{"pattern":"^[a-zA-Z][a-zA-Z0-9_]{2,63}$","type":"string"},"owner":{"type":"string"},"description":{"type":"string"},"feature_groups":{"type":"array","items":{"$ref":"#/components/schemas/DatasetFeatureGroup"}}}},"DatasetConfig":{"required":["dataframe_configurations"],"type":"object","properties":{"dataframe_configurations":{"type":"array","items":{"$ref":"#/components/schemas/Dataset"}}}},"DatasetFeatureGroup":{"required":["features","name"],"type":"object","properties":{"name":{"type":"string"},"features":{"uniqueItems":true,"type":"array","items":{"type":"string"}}}},"BigQueryTableReference":{"type":"object","properties":{"project_id":{"type":"string"},"dataset_name":{"type":"string"},"table_name":{"type":"string"},"entity_id_field":{"$ref":"#/components/schemas/StoreField"},"timestamp_field":{"$ref":"#/components/schemas/StoreField"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/StoreField"}},"store_type":{"type":"string","readOnly":true,"enum":["BIGQUERY","FIRESTORE"]}}},"DataFrame":{"required":["label","name"],"type":"object","properties":{"name":{"pattern":"^[a-zA-Z][a-zA-Z0-9_]{2,63}$","type":"string"},"label":{"type":"string"},"run_status":{"$ref":"#/components/schemas/RunStatusBigQueryTableReference"}}},"RunStatusBigQueryTableReference":{"required":["status"],"type":"object","properties":{"runId":{"type":"string","writeOnly":true},"status":{"type":"string","enum":["PENDING","RUNNING","FAILED","DONE"]},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"detail":{"type":"string"},"store_reference":{"$ref":"#/components/schemas/BigQueryTableReference"},"table_location":{"$ref":"#/components/schemas/TableLocation"}}},"Pageable":{"type":"object","properties":{"page":{"minimum":0,"type":"integer","format":"int32"},"size":{"minimum":1,"type":"integer","format":"int32"},"sort":{"type":"array","items":{"type":"string"}}}},"PageFeatureGroup":{"type":"object","properties":{"total_pages":{"type":"integer","format":"int32"},"total_elements":{"type":"integer","format":"int64"},"number_of_elements":{"type":"integer","format":"int32"},"number":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"sort":{"$ref":"#/components/schemas/Sort"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/FeatureGroup"}},"pageable":{"$ref":"#/components/schemas/Pageable"},"empty":{"type":"boolean"}}},"Sort":{"type":"object","properties":{"sorted":{"type":"boolean"},"unsorted":{"type":"boolean"},"empty":{"type":"boolean"}}},"PageDataFrame":{"type":"object","properties":{"total_pages":{"type":"integer","format":"int32"},"total_elements":{"type":"integer","format":"int64"},"number_of_elements":{"type":"integer","format":"int32"},"number":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"sort":{"$ref":"#/components/schemas/Sort"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/DataFrame"}},"pageable":{"$ref":"#/components/schemas/Pageable"},"empty":{"type":"boolean"}}}}}}

Desktop (please complete the following information):

  • OS: macos11.4
  • Python Version:
$ pipx --version
0.16.4
$ python --version
Python 2.7.17
  • openapi-python-client version 0.10.1, 0.10.2

Metadata

Metadata

Assignees

Labels

🐞bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions