Skip to content

Commit

Permalink
Add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander.A,Utkin committed Jan 10, 2025
1 parent b5e9455 commit 4ff832a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@ def new_transaction(
timeout: timedelta = timedelta(milliseconds=0)) -> Transaction
```

Starts a new transaction and return the transaction object to processing
Starts a new transaction and return the transaction object to processing.
Warning: once a timeout is set, it will apply to all subsequent steps in the transaction

#### Arguments:
namespace (string): A name of a namespace
Expand Down Expand Up @@ -672,6 +673,7 @@ def insert(item_def: Dict, precepts: List[str] = None) -> None
```

Inserts an item with its precepts to the transaction
Warning: the timeout set when the transaction was created is used

#### Arguments:
item_def (dict): A dictionary of item definition
Expand All @@ -690,6 +692,7 @@ def update(item_def: Dict, precepts: List[str] = None) -> None
```

Updates an item with its precepts to the transaction
Warning: the timeout set when the transaction was created is used

#### Arguments:
item_def (dict): A dictionary of item definition
Expand All @@ -708,6 +711,7 @@ def upsert(item_def: Dict, precepts: List[str] = None) -> None
```

Updates an item with its precepts to the transaction. Creates the item if it not exists
Warning: the timeout set when the transaction was created is used

#### Arguments:
item_def (dict): A dictionary of item definition
Expand All @@ -726,6 +730,7 @@ def delete(item_def: Dict) -> None
```

Deletes an item from the transaction
Warning: the timeout set when the transaction was created is used

#### Arguments:
item_def (dict): A dictionary of item definition
Expand Down
3 changes: 2 additions & 1 deletion pyreindexer/rx_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ def select(self, query: str, timeout: timedelta = timedelta(milliseconds=0)) ->

@raise_if_error
def new_transaction(self, namespace: str, timeout: timedelta = timedelta(milliseconds=0)) -> Transaction:
"""Starts a new transaction and return the transaction object to processing
"""Starts a new transaction and return the transaction object to processing.
Warning: once a timeout is set, it will apply to all subsequent steps in the transaction
#### Arguments:
namespace (string): A name of a namespace
Expand Down
4 changes: 4 additions & 0 deletions pyreindexer/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def _raise_on_is_over(self):
@raise_if_error
def insert(self, item_def: Dict, precepts: List[str] = None) -> None:
"""Inserts an item with its precepts to the transaction
Warning: the timeout set when the transaction was created is used
#### Arguments:
item_def (dict): A dictionary of item definition
Expand All @@ -89,6 +90,7 @@ def insert(self, item_def: Dict, precepts: List[str] = None) -> None:
@raise_if_error
def update(self, item_def: Dict, precepts: List[str] = None) -> None:
"""Updates an item with its precepts to the transaction
Warning: the timeout set when the transaction was created is used
#### Arguments:
item_def (dict): A dictionary of item definition
Expand All @@ -106,6 +108,7 @@ def update(self, item_def: Dict, precepts: List[str] = None) -> None:
@raise_if_error
def upsert(self, item_def: Dict, precepts: List[str] = None) -> None:
"""Updates an item with its precepts to the transaction. Creates the item if it not exists
Warning: the timeout set when the transaction was created is used
#### Arguments:
item_def (dict): A dictionary of item definition
Expand All @@ -123,6 +126,7 @@ def upsert(self, item_def: Dict, precepts: List[str] = None) -> None:
@raise_if_error
def delete(self, item_def: Dict) -> None:
"""Deletes an item from the transaction
Warning: the timeout set when the transaction was created is used
#### Arguments:
item_def (dict): A dictionary of item definition
Expand Down

0 comments on commit 4ff832a

Please sign in to comment.