Skip to content

Commit

Permalink
API Backwards compatability (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
tizz98 authored Dec 2, 2022
1 parent 781fa83 commit 546495a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.15
current_version = 0.0.16
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serialize =
{major}.{minor}.{patch}
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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).

## [Unreleased]

## [0.0.16] - 2022-12-02
### Fixed
- Fix API incompatibility when creating a parameterized notebook

## [0.0.15] - 2022-11-18
### Added
- Added `update_job_instance` client method
Expand Down
2 changes: 1 addition & 1 deletion origami/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.0.15"
version = "0.0.16"
8 changes: 6 additions & 2 deletions origami/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,17 @@ async def create_parameterized_notebook(
)
resp.raise_for_status()
resp_data = resp.json()
parameterized_notebook = NotebookFile.parse_obj(resp_data['parameterized_notebook'])

# Use .get(...) for backwards compatibility with old API which returns the NotebookFile as the response
parameterized_notebook = NotebookFile.parse_obj(
resp_data.get('parameterized_notebook', resp_data)
)
parameterized_notebook.content = httpx.get(
parameterized_notebook.presigned_download_url
).content.decode("utf-8")
job_instance_attempt = (
JobInstanceAttempt.parse_obj(resp_data['job_instance_attempt'])
if resp_data['job_instance_attempt']
if resp_data.get('job_instance_attempt')
else None
)

Expand Down
14 changes: 13 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[tool.poetry]
name = "noteable-origami"
version = "0.0.15"
version = "0.0.16"
description = "The Noteable API interface"
authors = ["Matt Seal <[email protected]>"]
maintainers = ["Matt Seal <[email protected]>"]
Expand Down Expand Up @@ -56,6 +56,7 @@ pytest-asyncio = "^0.19.0"
nox = "^2022.1.7"
nox-poetry = "^1.0.0"
pytest-httpx = "^0.21.0"
bump2version = "^1.0.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 546495a

Please sign in to comment.