Skip to content

Feature/post release cleanups #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Formatting
  • Loading branch information
1pxone committed May 26, 2025
commit 4089b9839d830d0f576bd017a662ef29725578cd
3 changes: 2 additions & 1 deletion src/rushdb/api/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List, Optional

from ..models.property import Property, PropertyValuesData
from ..models.search_query import SearchQuery, OrderDirection
from ..models.search_query import OrderDirection, SearchQuery
from ..models.transaction import Transaction
from .base import BaseAPI

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


class PropertiesAPI(BaseAPI):
"""API for managing properties in RushDB."""

Expand Down
14 changes: 3 additions & 11 deletions src/rushdb/api/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ def set(
) -> Dict[str, str]:
"""Update a record by ID."""
headers = Transaction._build_transaction_header(transaction)
return self.client._make_request(
"PUT", f"/records/{record_id}", data, headers
)
return self.client._make_request("PUT", f"/records/{record_id}", data, headers)

def update(
self,
Expand Down Expand Up @@ -62,9 +60,7 @@ def create(
"data": data,
"options": options or {"returnResult": True, "suggestTypes": True},
}
response = self.client._make_request(
"POST", "/records", payload, headers
)
response = self.client._make_request("POST", "/records", payload, headers)
return Record(self.client, response.get("data"))

def create_many(
Expand Down Expand Up @@ -192,11 +188,7 @@ def find(
try:
headers = Transaction._build_transaction_header(transaction)

path = (
f"/records/{record_id}/search"
if record_id
else "/records/search"
)
path = f"/records/{record_id}/search" if record_id else "/records/search"
response = self.client._make_request(
"POST",
path,
Expand Down
8 changes: 2 additions & 6 deletions src/rushdb/api/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ def begin(self, ttl: Optional[int] = None) -> Transaction:

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

def _rollback(self, transaction_id: str) -> None:
"""Internal method to rollback a transaction."""
return self.client._make_request(
"POST", f"/tx/{transaction_id}/rollback", {}
)
return self.client._make_request("POST", f"/tx/{transaction_id}/rollback", {})
Loading
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