Skip to content

Commit

Permalink
SL ready for 1.3.1 (#288)
Browse files Browse the repository at this point in the history
* bump to 1.3.1
* new abstractions diagram; ready for 1.3.1
* fight flaky count docs test
  • Loading branch information
hemidactylus authored Jun 26, 2024
1 parent 9d0a08d commit 85a3077
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v. 1.3.1
========
Fixed bug in parsing endpoint domain names containing hyphens (#287), by @bradfordcp
Added isort for source code formatting
Updated abstractions diagram in README for non-Astra environments

v. 1.3.0
========
Integration testing covers Astra and nonAstra smoothly:
Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import astrapy
ASTRA_DB_APPLICATION_TOKEN = "AstraCS:..."
ASTRA_DB_API_ENDPOINT = "https://01234567-....apps.astra.datastax.com"

my_client = astrapy.DataAPIClient(ASTRA_DB_APPLICATION_TOKEN)
my_database = my_client.get_database(ASTRA_DB_API_ENDPOINT)
my_client = astrapy.DataAPIClient()
my_database = my_client.get_database(
ASTRA_DB_API_ENDPOINT,
token=ASTRA_DB_APPLICATION_TOKEN,
)

my_collection = my_database.create_collection(
"dreams",
Expand Down Expand Up @@ -97,6 +100,7 @@ Here's a small admin-oriented example:
import astrapy


# this must have "Database Administrator" permissions:
ASTRA_DB_APPLICATION_TOKEN = "AstraCS:..."

my_client = astrapy.DataAPIClient(ASTRA_DB_APPLICATION_TOKEN)
Expand Down Expand Up @@ -136,8 +140,11 @@ import astrapy
ASTRA_DB_APPLICATION_TOKEN = "AstraCS:..."
ASTRA_DB_API_ENDPOINT = "https://01234567-....apps.astra.datastax.com"

my_client = astrapy.DataAPIClient(ASTRA_DB_APPLICATION_TOKEN)
my_database = my_client.get_database(ASTRA_DB_API_ENDPOINT)
my_client = astrapy.DataAPIClient()
my_database = my_client.get_database(
ASTRA_DB_API_ENDPOINT,
token=ASTRA_DB_APPLICATION_TOKEN,
)
my_collection = my_database.dreams

my_collection.insert_one({"when": datetime.datetime.now()})
Expand Down Expand Up @@ -177,8 +184,11 @@ import bson
ASTRA_DB_APPLICATION_TOKEN = "AstraCS:..."
ASTRA_DB_API_ENDPOINT = "https://01234567-....apps.astra.datastax.com"

my_client = astrapy.DataAPIClient(ASTRA_DB_APPLICATION_TOKEN)
my_database = my_client.get_database(ASTRA_DB_API_ENDPOINT)
my_client = astrapy.DataAPIClient()
my_database = my_client.get_database(
ASTRA_DB_API_ENDPOINT,
token=ASTRA_DB_APPLICATION_TOKEN,
)

my_collection = my_database.create_collection(
"ecommerce",
Expand Down
Binary file modified pictures/astrapy_abstractions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 = "astrapy"
version = "1.3.0"
version = "1.3.1"
description = "AstraPy is a Pythonic SDK for DataStax Astra and its Data API"
authors = [
"Stefano Lottini <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion tests/idiomatic/integration/test_timeout_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_collection_count_documents_timeout_sync(
) -> None:
sync_empty_collection.insert_many([{"a": 1}] * 100)
time.sleep(10)
assert sync_empty_collection.count_documents({}, upper_bound=150) >= 100
assert sync_empty_collection.count_documents({}, upper_bound=500) >= 100

with pytest.raises(DataAPITimeoutException) as exc:
sync_empty_collection.count_documents({}, upper_bound=150, max_time_ms=1)
Expand Down

0 comments on commit 85a3077

Please sign in to comment.