Skip to content

Commit

Permalink
Update timeout comment. Minimum
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander.A,Utkin committed Jan 17, 2025
1 parent e1897cd commit ad21eb3
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 51 deletions.
100 changes: 75 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ Opens a namespace specified or creates a namespace if it does not exist

#### Arguments:
namespace (string): A name of a namespace
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -179,7 +181,9 @@ Closes a namespace specified

#### Arguments:
namespace (string): A name of a namespace
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -198,7 +202,9 @@ Drops a namespace specified

#### Arguments:
namespace (string): A name of a namespace
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
Exception: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -220,7 +226,9 @@ Gets a list of namespaces available
#### Arguments:
enum_not_opened (bool, optional): An enumeration mode flag. If it is
set then closed namespaces are in result list too. Defaults to False
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(:obj:`list` of :obj:`dict`): A list of dictionaries which describe each namespace
Expand All @@ -245,7 +253,9 @@ Adds an index to the namespace specified
#### Arguments:
namespace (string): A name of a namespace
index_def (dict): A dictionary of index definition
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -267,7 +277,9 @@ Updates an index in the namespace specified
#### Arguments:
namespace (string): A name of a namespace
index_def (dict): A dictionary of index definition
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -289,7 +301,9 @@ Drops an index from the namespace specified
#### Arguments:
namespace (string): A name of a namespace
index_name (string): A name of an index
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -314,7 +328,9 @@ Inserts an item with its precepts to the namespace specified
namespace (string): A name of a namespace
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -339,7 +355,9 @@ Updates an item with its precepts in the namespace specified
namespace (string): A name of a namespace
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -364,7 +382,9 @@ Updates an item with its precepts in the namespace specified. Creates the item i
namespace (string): A name of a namespace
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -386,7 +406,9 @@ Deletes an item from the namespace specified
#### Arguments:
namespace (string): A name of a namespace
item_def (dict): A dictionary of item definition
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -410,7 +432,9 @@ Puts metadata to a storage of Reindexer by key
namespace (string): A name of a namespace
key (string): A key in a storage of Reindexer for metadata keeping
value (string): A metadata for storage
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -431,7 +455,9 @@ Gets metadata from a storage of Reindexer by key specified
#### Arguments:
namespace (string): A name of a namespace
key (string): A key in a storage of Reindexer where metadata is kept
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
string: A metadata value
Expand All @@ -455,7 +481,9 @@ Deletes metadata from a storage of Reindexer by key specified
#### Arguments:
namespace (string): A name of a namespace
key (string): A key in a storage of Reindexer where metadata is kept
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
Expand All @@ -475,7 +503,9 @@ Gets a list of metadata keys from a storage of Reindexer

#### Arguments:
namespace (string): A name of a namespace
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(:obj:`list` of :obj:`str`): A list of all metadata keys
Expand All @@ -498,7 +528,9 @@ Executes an SQL query and returns query results

#### Arguments:
query (string): An SQL query
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
Expand All @@ -522,7 +554,9 @@ Starts a new transaction and return the transaction object to processing.

#### Arguments:
namespace (string): A name of a namespace
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(:obj:`Transaction`): A new transaction
Expand Down Expand Up @@ -750,7 +784,9 @@ def commit(timeout: timedelta = timedelta(milliseconds=0)) -> None
Applies changes

#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
Expand All @@ -767,7 +803,9 @@ def commit_with_count(timeout: timedelta = timedelta(milliseconds=0)) -> int
Applies changes and return the number of count of changed items

#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
Expand All @@ -784,7 +822,9 @@ def rollback(timeout: timedelta = timedelta(milliseconds=0)) -> None
Rollbacks changes

#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
Expand Down Expand Up @@ -1391,7 +1431,9 @@ def execute(timeout: timedelta = timedelta(milliseconds=0)) -> QueryResults
Executes a select query

#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
Expand All @@ -1411,7 +1453,9 @@ def delete(timeout: timedelta = timedelta(milliseconds=0)) -> int
Executes a query, and delete items, matches query

#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(int): Number of deleted elements
Expand Down Expand Up @@ -1505,7 +1549,9 @@ def update(timeout: timedelta = timedelta(milliseconds=0)) -> QueryResults
Executes update query, and update fields in items, which matches query

#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
Expand All @@ -1526,7 +1572,9 @@ def must_execute(timeout: timedelta = timedelta(
Executes a query, and update fields in items, which matches query, with status check

#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
Expand All @@ -1546,7 +1594,9 @@ def get(timeout: timedelta = timedelta(milliseconds=0)) -> (str, bool)
Executes a query, and return 1 JSON item

#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)

#### Returns:
(:tuple:string,bool): 1st string item and found flag
Expand Down
20 changes: 15 additions & 5 deletions pyreindexer/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,9 @@ def execute(self, timeout: timedelta = timedelta(milliseconds=0)) -> QueryResult
"""Executes a select query
#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)
#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
Expand All @@ -762,7 +764,9 @@ def delete(self, timeout: timedelta = timedelta(milliseconds=0)) -> int:
"""Executes a query, and delete items, matches query
#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)
#### Returns:
(int): Number of deleted elements
Expand Down Expand Up @@ -858,7 +862,9 @@ def update(self, timeout: timedelta = timedelta(milliseconds=0)) -> QueryResults
"""Executes update query, and update fields in items, which matches query
#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)
#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
Expand All @@ -882,7 +888,9 @@ def must_execute(self, timeout: timedelta = timedelta(milliseconds=0)) -> QueryR
"""Executes a query, and update fields in items, which matches query, with status check
#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)
#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
Expand All @@ -901,7 +909,9 @@ def get(self, timeout: timedelta = timedelta(milliseconds=0)) -> (str, bool):
"""Executes a query, and return 1 JSON item
#### Arguments:
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation
timeout (`datetime.timedelta`): Optional timeout for performing a server-side operation.
Minimum 1 millisecond, if set to a value less, it corresponds to disabling the timeout.
A value of 0 disables the timeout (default value)
#### Returns:
(:tuple:string,bool): 1st string item and found flag
Expand Down
Loading

0 comments on commit ad21eb3

Please sign in to comment.