Skip to content

Commit

Permalink
(fix, python): check autogenerated examples before indexing (#4294)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Aug 13, 2024
1 parent f4a1886 commit fe3c445
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions generators/python/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.10.1] - 2024-08-13

- Fix: If there are no autogenerated examples present, the Python SDK generator no longer fails.

## [3.10.0] - 2024-08-09

- Feat: Adds a new flag to generate forward compatible Python enums, as opposed to leveraging raw string enums as literals. This works through addding an "\_UNKNOWN" member to your enum set, the value of which is the raw value of the unrecognized enum.
Expand Down
2 changes: 1 addition & 1 deletion generators/python/sdk/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.0
3.10.1
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def _generate_endpoint_snippets(
# Stick to user provided examples for snippets for now,
# only use autogenerated if no user-provided examples are available, and if you're doing this, just pick the first.
examples = [ex.example for ex in endpoint.user_specified_examples]
if len(endpoint.user_specified_examples) == 0:
if len(endpoint.user_specified_examples) == 0 and len(endpoint.autogenerated_examples) > 0:
examples = [endpoint.autogenerated_examples[0].example]
snippets: List[GeneratedEndpointFunctionSnippet] = []
for example in examples:
Expand Down

0 comments on commit fe3c445

Please sign in to comment.