Skip to content

Commit 4ee91dd

Browse files
Merge pull request #6 from OptimeeringAS/0.0.3-release
Release 0.0.3 - Minor bug fixes
2 parents b65fc3a + 6002ad5 commit 4ee91dd

File tree

5 files changed

+33
-9
lines changed

5 files changed

+33
-9
lines changed

BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ python_distribution(
1212
output_path="optimeering-python-sdk",
1313
provides=python_artifact(
1414
name="optimeering",
15-
version="0.0.2",
15+
version="0.0.3",
1616
description="Optimeering Python Client",
1717
long_description_content_type="text/markdown",
1818
author="Optimeering",

generate/python_templates/api.mustache

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ class {{classname}}:
101101
next_page = next_pagination.next_page
102102

103103
if attribute_to_extend_selected:
104-
if next_pagination.items[0].series_id == paginated_response.items[-1].series_id:
104+
try:
105+
first_item=next_pagination.items[0]
106+
except IndexError:
107+
break
108+
if first_item.series_id == paginated_response.items[-1].series_id:
105109
# if series id is same, extract the first item and extend to last item
106110
continued_data: List = getattr(next_pagination.items.pop(0), attribute_to_extend_selected)
107111
previous_data: List = getattr(paginated_response.items[-1], attribute_to_extend_selected)

generate/python_templates/partial_api_args_pagination_removed.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
{{#vendorExtensions.x-optimeering-comma-separated.data-type}}
1818
{{! OPTIMEERING PYTHON TYPE OVERWRITE}}
1919
{{paramName}}: Annotated[
20-
{{^required}}Optional[{{/required}}{{{vendorExtensions.x-optimeering-comma-separated.data-type}}}{{^required}}]{{/required}}{{^required}},
20+
{{^required}}Optional[{{/required}}{{{vendorExtensions.x-optimeering-comma-separated.data-type}}}{{^required}}]{{/required}},
2121
Field(description="{{#description}}{{{.}}}{{/description}}")
22-
] = None{{/required}}, {{/vendorExtensions.x-optimeering-comma-separated.data-type}}
22+
] {{^required}}= None{{/required}}, {{/vendorExtensions.x-optimeering-comma-separated.data-type}}
2323
{{/vendorExtensions.x-optimeering-pagination-parameter.value}}
2424
{{/allParams}}
2525
_request_timeout: Union[

optimeering/api/access_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ def list_my_keys(
261261
next_page = next_pagination.next_page
262262

263263
if attribute_to_extend_selected:
264-
if next_pagination.items[0].series_id == paginated_response.items[-1].series_id:
264+
try:
265+
first_item = next_pagination.items[0]
266+
except IndexError:
267+
break
268+
if first_item.series_id == paginated_response.items[-1].series_id:
265269
# if series id is same, extract the first item and extend to last item
266270
continued_data: List = getattr(next_pagination.items.pop(0), attribute_to_extend_selected)
267271
previous_data: List = getattr(paginated_response.items[-1], attribute_to_extend_selected)

optimeering/api/predictions_api.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ def list_series(
232232
next_page = next_pagination.next_page
233233

234234
if attribute_to_extend_selected:
235-
if next_pagination.items[0].series_id == paginated_response.items[-1].series_id:
235+
try:
236+
first_item = next_pagination.items[0]
237+
except IndexError:
238+
break
239+
if first_item.series_id == paginated_response.items[-1].series_id:
236240
# if series id is same, extract the first item and extend to last item
237241
continued_data: List = getattr(next_pagination.items.pop(0), attribute_to_extend_selected)
238242
previous_data: List = getattr(paginated_response.items[-1], attribute_to_extend_selected)
@@ -585,7 +589,11 @@ def retrieve(
585589
next_page = next_pagination.next_page
586590

587591
if attribute_to_extend_selected:
588-
if next_pagination.items[0].series_id == paginated_response.items[-1].series_id:
592+
try:
593+
first_item = next_pagination.items[0]
594+
except IndexError:
595+
break
596+
if first_item.series_id == paginated_response.items[-1].series_id:
589597
# if series id is same, extract the first item and extend to last item
590598
continued_data: List = getattr(next_pagination.items.pop(0), attribute_to_extend_selected)
591599
previous_data: List = getattr(paginated_response.items[-1], attribute_to_extend_selected)
@@ -743,7 +751,11 @@ def retrieve_latest(
743751
next_page = next_pagination.next_page
744752

745753
if attribute_to_extend_selected:
746-
if next_pagination.items[0].series_id == paginated_response.items[-1].series_id:
754+
try:
755+
first_item = next_pagination.items[0]
756+
except IndexError:
757+
break
758+
if first_item.series_id == paginated_response.items[-1].series_id:
747759
# if series id is same, extract the first item and extend to last item
748760
continued_data: List = getattr(next_pagination.items.pop(0), attribute_to_extend_selected)
749761
previous_data: List = getattr(paginated_response.items[-1], attribute_to_extend_selected)
@@ -911,7 +923,11 @@ def retrieve_versioned(
911923
next_page = next_pagination.next_page
912924

913925
if attribute_to_extend_selected:
914-
if next_pagination.items[0].series_id == paginated_response.items[-1].series_id:
926+
try:
927+
first_item = next_pagination.items[0]
928+
except IndexError:
929+
break
930+
if first_item.series_id == paginated_response.items[-1].series_id:
915931
# if series id is same, extract the first item and extend to last item
916932
continued_data: List = getattr(next_pagination.items.pop(0), attribute_to_extend_selected)
917933
previous_data: List = getattr(paginated_response.items[-1], attribute_to_extend_selected)

0 commit comments

Comments
 (0)