Releases: posit-dev/posit-sdk-py
Releases · posit-dev/posit-sdk-py
v0.5.0
What's Changed
- fix: use correct args and kwargs definitions by @tdstein in #256
- feat!: implement snowflake auth helpers by @dbkegley in #268
- feat: deprecates field access by attribute. by @tdstein in #266
- feat: add oauth session, integration, and association apis @zackverham in #267 and #286
- fix: content overload signatures by @tdstein in #290
- feat: add find_by method to content by @tdstein in #296
Breaking Changes
- The positional argument order of
posit.connect.external.PositCredentialsStrategy
has changed in #268
New Contributors
- @zackverham made their first contribution in #267
- @dependabot made their first contribution in #287
Full Changelog: v0.4.0...v0.5.0
v0.4.0
What's Changed
- refactor!: apply flake8 builtin rules by @tdstein in #248
- feat: replace restart environment variable hash with Unix epoch by @tdstein in #251
- feat!: improve compatibility with Databricks SQL client by @dbkegley in #252
Breaking Changes
- refactor: rename
bundles.create
method argument frominput
toarchive
by @tdstein in #248 - refactor: rename
bundles.get
method argument fromid
touid
by @tdstein in #248 - refactor: rename
permissions.get
method argument fromid
touid
by @tdstein in #248 - refactor: rename
tasks.get
method argument fromid
touid
by @tdstein in #248 - refactor: rewrite
external.databricks
helpers for better interop betweendatabricks-sdk-python
anddatabricks-sql-python
by @dbkegley #252
Migration Guide
This release includes changes to remove shadowing of builtins. As a result, the argument names for various methods have changed. This change only impacts method invocations using keyword-arguments. Methods invoked without keyword-arguments do not require adjustments.
refactor: rename bundles.create
method argument from input
to archive
by @tdstein in #248
Rename the keyword-argument input
to archive
.
Previous
from posit import connect
client = connect.Client()
content = client.content.find_one()
bundle = content.bundles.create(input="archive.tar.gz")
Current
from posit import connect
client = connect.Client()
content = client.content.find_one()
bundle = content.bundles.create(archive="archive.tar.gz")
refactor: rename bundles.get
method argument from id
to uid
by @tdstein in #248
Rename the keyword-argument id
to uid
.
Previous
from posit import connect
client = connect.Client()
content = client.content.find_one()
bundle = content.bundles.get(id="3bb97e21-8216-445c-95b7-288578ca4311")
Current
from posit import connect
client = connect.Client()
content = client.content.find_one()
bundle = content.bundles.get(uid="3bb97e21-8216-445c-95b7-288578ca4311")
refactor: rename permissions.get
method argument from id
to uid
by @tdstein in #248
Rename the keyword-argument id
to uid
.
Previous
from posit import connect
client = connect.Client()
content = client.content.find_one()
permission = content.permissions.get(id="3bb97e21-8216-445c-95b7-288578ca4311")
Current
from posit import connect
client = connect.Client()
content = client.content.find_one()
permission = content.permissions.get(uid="3bb97e21-8216-445c-95b7-288578ca4311")
refactor: rename tasks.get
method argument from id
to uid
by @tdstein in #248
Rename the keyword-argument id
to uid
.
Previous
from posit import connect
client = connect.Client()
task = client.tasks.get(id="CmsfmnfDDyRUrsAc")
Current
from posit import connect
client = connect.Client()
task = client.tasks.get(uid="CmsfmnfDDyRUrsAc")
refactor: rewrite external.databricks
helpers for better interop between databricks-sdk-python
and databricks-sql-python
by @dbkegley #252
Previous
from databricks import sql
from databricks.sdk.core import ApiClient, Config
from databricks.sdk.service.iam import CurrentUserAPI
from posit.connect.external.databricks import viewer_credentials_provider
session_token = "<read-from-http-header>"
credentials_provider = viewer_credentials_provider(
user_session_token=session_token
)
# databricks-sdk usage
cfg = Config(
host=DATABRICKS_HOST_URL,
credentials_provider=credentials_provider
)
databricks_user = CurrentUserAPI(ApiClient(cfg)).me()
print(databricks_user)
# databricks-sql usage
with sql.connect(
server_hostname=DATABRICKS_HOST,
http_path=SQL_HTTP_PATH,
auth_type="databricks-oauth", # old local credential_provider fallback behavior
credentials_provider=credentials_provider,
) as connection:
with connection.cursor() as cursor:
cursor.execute("SELECT * FROM samples.nyctaxi.trips LIMIT 10;")
result = cursor.fetchall()
print(result)
Current
Warning
Requires databricks-sdk>=0.29.0
from databricks import sql
from databricks.sdk.core import ApiClient, Config, databricks_cli
from databricks.sdk.service.iam import CurrentUserAPI
from posit.connect.external.databricks import PositCredentialsStrategy
session_token = "<read-from-http-header>"
posit_strategy = PositCredentialsStrategy(
local_strategy=databricks_cli, # new local credential_provider fallback behavior
user_session_token=session_token)
cfg = Config(
host=DATABRICKS_HOST_URL,
# uses Posit's custom credential_strategy if running on Connect,
# otherwise falls back to the strategy defined by local_strategy
credentials_strategy=posit_strategy)
databricks_user = CurrentUserAPI(ApiClient(cfg)).me()
print(databricks_user)
with sql.connect(
server_hostname=DATABRICKS_HOST,
http_path=SQL_HTTP_PATH,
# https://github.com/databricks/databricks-sql-python/issues/148#issuecomment-2271561365
credentials_provider=posit_strategy.sql_credentials_provider(cfg)
) as connection:
with connection.cursor() as cursor:
cursor.execute("SELECT * FROM samples.nyctaxi.trips LIMIT 10;")
result = cursor.fetchall()
print(result)
Full Changelog: v0.3.1...v0.4.0
v0.3.1
v0.3.0
v0.2.2
v0.2.1
What's Changed
- feat: add dataclass to represent ContentItem owner by @brooklynbagel in #190
- feat: Check for X-Deprecated-Endpoint header by @nealrichardson in #195
New Contributors
- @brooklynbagel made their first contribution in #190
Full Changelog: v0.2.0...v0.2.1
v0.2.0
What's Changed
- chore: updates classifiers by @tdstein in #133
- docs: adds linting for docstrings by @tdstein in #136
- feat: adds permissions find, find_one, and update by @tdstein in #145
- fix: removes dangling NotImplementedError throws by @tdstein in #146
- feat: adds permissions create by @tdstein in #147
- feat: adds permissions get by @tdstein in #148
- feat: adds permission delete by @tdstein in #149
- feat: adds permissions count by @tdstein in #150
- style: replace unpacking usage with dict.update by @tdstein in #151
- docs: adds warning for make behavior by @tdstein in #154
- feat: adds content create by @tdstein in #155
- feat: adds content-item delete by @tdstein in #156
- fix: removes resource warning messages. by @tdstein in #159
- feat: adds bundles by @tdstein in #161
- feat: adds visits find and find_one by @tdstein in #163
- feat: adds owner property to content-item. by @tdstein in #160
- refactor: reduces complexity of urls module. by @tdstein in #168
- feat: adds usage by @tdstein in #166
- style: sets ruff docstring-code-line-length to dynamic by @tdstein in #171
- style: applies formatting by @tdstein in #172
- build: delete empty directories on clean by @tdstein in #177
- feat: adds metrics view events by @tdstein in #170
- feat: adds bundle create and download by @tdstein in #179
- feat: adds bundle/content deploy and task management by @tdstein in #183
- feat: sets default value for optional event fields by @tdstein in #185
- refactor: renames views to usage by @tdstein in #186
Full Changelog: v0.1.0...v0.2.0
v0.1.0
What's Changed
- ci: adds action to test on push by @tdstein in #2
- feat: adds boilerplate for config with factories. by @tdstein in #1
- build: sets pinned requirements. by @tdstein in #5
- feat: adds
get_user
andget_current_user
methods. by @tdstein in #7 - refactor: reduces config complexity by @tdstein in #13
- Design by wishful thinking for Connect SDK by @nealrichardson in #16
- fix: handle_errors should handle non-JSON error responses by @nealrichardson in #19
- feat: adds abstraction for resources and subsequent implementation of users. by @tdstein in #20
- build: migrates build tooling to Makefile by @tdstein in #21
- fix: adds page size validation by @tdstein in #26
- chore: don't fail the build for having less than 100 percent coverage by @nealrichardson in #32
- chore: refactor some tests to use less Mock by @nealrichardson in #30
- feat: try making Client the contextmanager itself by @nealrichardson in #31
- chore: splits unit tests by type by @tdstein in #37
- doc: put some words in README.md by @nealrichardson in #38
- feat: adds passthrough methods for each HTTP request type by @tdstein in #25
- feat: pull the Connect server's version (lazily) by @nealrichardson in #39
- build: disables coverage threshold for new files by @tdstein in #41
- ci: adds main.yaml by @tdstein in #42
- ci: fixes main.yaml job name by @tdstein in #43
- fix: url path resolution by @tdstein in #44
- fix: allow chaining paths with urls.append_path by @tdstein in #45
- test: Add tests for Users with mock responses by @nealrichardson in #46
- refactor: simplify Users, factor out paginator by @nealrichardson in #49
- feat: add client.me property that calls v1/user (lazily) by @nealrichardson in #51
- feat: initial support for getting content by @nealrichardson in #53
- Adds an OAuthIntegration by @dbkegley in #52
- chore: applies formatting by @tdstein in #56
- ci: adds release automation by @tdstein in #57
- build: adds pre-commit to developer workflow by @tdstein in #63
- build: removes pinned versions by @tdstein in #64
- Fix example and rename to streamlit by @dbkegley in #65
- build: adds fix to pre-commit hooks by @tdstein in #66
- ci: adds action to lint conventional commits. by @tdstein in #70
- chore: Move tests to tests/ dir by @nealrichardson in #60
- ci: fix main workflow by @nealrichardson in #72
- chore: updates README and adds CODE_OF_CONDUCT by @tdstein in #68
- docs: Added Shiny for Python example by @plascaray in #74
- docs: Added Dash example. by @plascaray in #76
- docs: update streamlit example and readmes by @dbkegley in #78
- docs: Added FastAPI example. by @plascaray in #77
- chore: applies formatting by @tdstein in #80
- ci: disables trigger for pull_request_target by @tdstein in #82
- build: moves editable installs to make dev by @tdstein in #81
- chore: adds CODEOWNERS by @tdstein in #84
- docs: Added Flask example. by @plascaray in #79
- style: Remove unneccesary method in FastAPI example by @hekhuisk in #85
- chore: Factor some mock responses to JSON files and read them in with a helper by @nealrichardson in #86
- chore: Finish test fixture moves by @nealrichardson in #88
- chore: adds additional files to clean target by @tdstein in #90
- feat: adds base class definition for resources by @tdstein in #83
- feat: switch User and Content to inherit dict, add update method for User by @nealrichardson in #94
- feat: adds base class 'Resource' and modifies 'User'. by @tdstein in #98
- refactor: moves session and url to resource attributes by @tdstein in #103
- feat: adds count method to resources by @tdstein in #105
- fix: use query params in count request by @tdstein in #115
- refactor: removes erroneous print statement by @tdstein in #118
- refactor: moves pagination logic to paginator by @tdstein in #116
- feat: set user attributes on update by @tdstein in #119
- refactor: inject config instead of url into resource by @tdstein in #124
- feat: adds user.lock() and user.unlock() by @tdstein in #123
- feat: adds update support to content by @tdstein in #120
- fix: correct url for ContentItem update by @tdstein in #125
- refactor: consistent update method signature by @tdstein in #122
- fix: skip editable install on release by @tdstein in #126
- fix: skip editable install on release by @tdstein in #128
- feat!: removes filter parameter from content.find and content.find_one. by @tdstein in #129
- feat: adds query params to find and find_one by @tdstein in #130
- docs: updates readme with additional usage information by @tdstein in #131
New Contributors
- @nealrichardson made their first contribution in #16
- @dbkegley made their first contribution in #52
- @plascaray made their first contribution in #74
- @hekhuisk made their first contribution in #85
Full Changelog: https://github.com/posit-dev/posit-sdk-py/commits/v0.1.0