Skip to content

Commit

Permalink
Prepare Release 0.13.2 (#202)
Browse files Browse the repository at this point in the history
* update deps and bump version number

* adjust tests to platform change
  • Loading branch information
philkra committed Jun 1, 2024
1 parent 8880fcb commit 7efe287
Show file tree
Hide file tree
Showing 7 changed files with 448 additions and 453 deletions.
881 changes: 438 additions & 443 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "xata"
version = "0.13.1"
version = "0.13.2"
description = "Python client for Xata.io"
authors = ["Xata <support@xata.io>"]
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration-tests/search_and_filter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_search_table(self):
assert r.status_code == 200

r = self.client.search_and_filter().searchTable("NonExistingTable", payload)
assert r.status_code == 404
assert r.status_code == 200

r = self.client.search_and_filter().searchTable("Posts", {"invalid": "query"})
assert r.status_code == 400
Expand Down Expand Up @@ -171,7 +171,7 @@ def test_aggregate_table(self):
assert r.json()["aggs"]["titles"] == len(self.posts)

r = self.client.search_and_filter().aggregateTable("NonExistingTable", payload)
assert r.status_code == 404
assert r.status_code == 200

r = self.client.search_and_filter().aggregateTable("Posts", {"aggs": {"foo": "bar"}})
assert r.status_code == 400
4 changes: 1 addition & 3 deletions tests/integration-tests/sql_query_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_query_with_invalid_statement(self):
def test_query_statement_with_missing_params(self):
r = self.client.sql().query("SELECT * FROM \"Users\" WHERE email = '$1'")
assert r.status_code == 200
assert len(r.json()) == 0
assert len(r.json().get("records")) == 0

def test_query_statement_with_params_and_no_param_references(self):
r = self.client.sql().query('SELECT * FROM "Users"', ["This is important"])
Expand All @@ -87,14 +87,12 @@ def test_insert(self):
"INSERT INTO \"Users\" (name, email) VALUES ('Leslie Nielsen', 'leslie@example.com')"
)
assert r.status_code == 201
assert not r.json()

def test_insert_with_params(self):
r = self.client.sql().query(
'INSERT INTO "Users" (name, email) VALUES ($1, $2)', ["Keanu Reeves", "keanu@example.com"]
)
assert r.status_code == 201
assert not r.json()

def test_query_with_params(self):
r = self.client.sql().query('SELECT * FROM "Users" WHERE email = $1', ["keanu@example.com"])
Expand Down
4 changes: 3 additions & 1 deletion tests/integration-tests/table_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_add_column(self, columns: dict, new_column: dict):
assert r.json() == columns

r = self.client.table().addTableColumn("NonExistingTable", {"name": "foo"})
assert r.status_code == 404
assert r.status_code == 400

r = self.client.table().addTableColumn("Posts", {"name": "foo"})
assert r.status_code == 400
Expand Down Expand Up @@ -214,6 +214,7 @@ def test_delete_column(self, columns: dict):
assert r.status_code == 200
assert r.json() == columns

"""
def test_deprecated_object_header(self):
r = self.client.table().getTableColumns("Posts")
assert r.status_code == 200
Expand All @@ -222,3 +223,4 @@ def test_deprecated_object_header(self):
r.headers["x-xata-message"]
== "The deprecated object column type will be removed on Dec 13, 2023 - Please consult https://xata.io/to/object-migration for migration."
)
"""
4 changes: 2 additions & 2 deletions tests/integration-tests/workspaces_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def setup_class(self):
self.db_name = utils.get_db_name()
self.branch_name = "main"
self.client = XataClient(db_name=self.db_name, branch_name=self.branch_name)
self.workspace_name = "py-sdk-tests-%s" % utils.get_random_string(6)
self.workspace_name = "sdk-integration-py-%s" % utils.get_random_string(6)

#
# Workspace Ops
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_update_workspace_member(self):
)
assert r.status_code == 403
r = self.client.workspaces().updateWorkspaceMemberRole("NonExistingUserId", payload)
assert r.status_code == 403
assert r.status_code == 404
r = self.client.workspaces().updateWorkspaceMemberRole(pytest.workspaces["member"]["userId"], {})
assert r.status_code == 400

Expand Down
2 changes: 1 addition & 1 deletion xata/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

# TODO this is a manual task, to keep in sync with pyproject.toml
# could/should be automated to keep in sync
__version__ = "0.13.1"
__version__ = "0.13.2"

PERSONAL_API_KEY_LOCATION = "~/.config/xata/key"
DEFAULT_DATA_PLANE_DOMAIN = "xata.sh"
Expand Down

0 comments on commit 7efe287

Please sign in to comment.