Skip to content

Commit 4089b98

Browse files
committed
Formatting
1 parent f7ab955 commit 4089b98

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

src/rushdb/api/properties.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import List, Optional
33

44
from ..models.property import Property, PropertyValuesData
5-
from ..models.search_query import SearchQuery, OrderDirection
5+
from ..models.search_query import OrderDirection, SearchQuery
66
from ..models.transaction import Transaction
77
from .base import BaseAPI
88

@@ -13,6 +13,7 @@ class PropertyValuesQuery(SearchQuery, total=False):
1313
query: Optional[str] # For text search among values
1414
orderBy: Optional[OrderDirection] # Simplified to only asc/desc for values
1515

16+
1617
class PropertiesAPI(BaseAPI):
1718
"""API for managing properties in RushDB."""
1819

src/rushdb/api/records.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ def set(
1919
) -> Dict[str, str]:
2020
"""Update a record by ID."""
2121
headers = Transaction._build_transaction_header(transaction)
22-
return self.client._make_request(
23-
"PUT", f"/records/{record_id}", data, headers
24-
)
22+
return self.client._make_request("PUT", f"/records/{record_id}", data, headers)
2523

2624
def update(
2725
self,
@@ -62,9 +60,7 @@ def create(
6260
"data": data,
6361
"options": options or {"returnResult": True, "suggestTypes": True},
6462
}
65-
response = self.client._make_request(
66-
"POST", "/records", payload, headers
67-
)
63+
response = self.client._make_request("POST", "/records", payload, headers)
6864
return Record(self.client, response.get("data"))
6965

7066
def create_many(
@@ -192,11 +188,7 @@ def find(
192188
try:
193189
headers = Transaction._build_transaction_header(transaction)
194190

195-
path = (
196-
f"/records/{record_id}/search"
197-
if record_id
198-
else "/records/search"
199-
)
191+
path = f"/records/{record_id}/search" if record_id else "/records/search"
200192
response = self.client._make_request(
201193
"POST",
202194
path,

src/rushdb/api/transactions.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ def begin(self, ttl: Optional[int] = None) -> Transaction:
1818

1919
def _commit(self, transaction_id: str) -> None:
2020
"""Internal method to commit a transaction."""
21-
return self.client._make_request(
22-
"POST", f"/tx/{transaction_id}/commit", {}
23-
)
21+
return self.client._make_request("POST", f"/tx/{transaction_id}/commit", {})
2422

2523
def _rollback(self, transaction_id: str) -> None:
2624
"""Internal method to rollback a transaction."""
27-
return self.client._make_request(
28-
"POST", f"/tx/{transaction_id}/rollback", {}
29-
)
25+
return self.client._make_request("POST", f"/tx/{transaction_id}/rollback", {})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy