-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDK/CLI] Update SDK restclient 2023-11-23 (#1101)
# Description Please add an informative description that covers that changes made by the pull request and link all relevant issues. # All Promptflow Contribution checklist: - [ ] **The pull request does not introduce [breaking changes].** - [ ] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).** - [ ] **Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: [suggested workflow](../CONTRIBUTING.md#suggested-workflow).** ## General Guidelines and Best Practices - [ ] Title of the pull request is clear and informative. - [ ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [ ] Pull request includes test coverage for the included changes.
- Loading branch information
Showing
26 changed files
with
33,252 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,61 @@ Rest client code in this folder are not manually written, but generated by autor | |
Download swagger.json from [here](https://int.api.azureml-test.ms/flow/swagger/v1.0/swagger.json) to | ||
[promptflow/azure/_restclient](../promptflow/azure/_restclient) | ||
|
||
## update code | ||
## Update code | ||
+ cd to [promptflow/azure/_restclient](../promptflow/azure/_restclient) | ||
+ run `autorest --v3 --python --track2 --version=3.8.0 --use=@autorest/[email protected] --input-file=swagger.json --output-folder=. --namespace=flow --modelerfour.lenient-model-deduplication` | ||
+ don't change `--use`. latest version of `autorest/python` will generate code following different pattern, which is not compatible with our code. | ||
|
||
## Update the generation history | ||
|
||
- 2023.11.13 - Generated. | ||
|
||
## Troubleshooting | ||
|
||
### Duplicate object schemas with "xxx" name detected. | ||
|
||
This may be caused by the duplicate generated class names. | ||
|
||
```json | ||
"FlowFeature": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"nullable": true | ||
}, | ||
"description": { | ||
"type": "string", | ||
"nullable": true | ||
}, | ||
"state": { | ||
"type": "object", | ||
"properties": { | ||
"Runtime": { | ||
"$ref": "#/components/schemas/FlowFeatureState" | ||
}, | ||
"Executor": { | ||
"$ref": "#/components/schemas/FlowFeatureState" | ||
}, | ||
"PFS": { | ||
"$ref": "#/components/schemas/FlowFeatureState" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"nullable": true | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"FlowFeatureState": { | ||
"enum": [ | ||
"Ready", | ||
"E2ETest" | ||
], | ||
"type": "string" | ||
}, | ||
``` | ||
|
||
`FlowFeature` has a nested object field `state`, which will be generated to a new class named `FlowFeatureState`, and it duplicates with the enum `FlowFeatureState`. | ||
|
||
To fix this, server side needs to change the class name in the schema, in this case, server side changed the object `state` to `states` and the problem is resolved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.