kaskada.client
Module Contents
Classes
A Kaskada Client connects to the Kaskada Manager API |
Functions
|
Upates the IPython interactive shell to show tracebook |
|
Resets the global variables for the client module. |
|
Sets the default slice used in every query |
|
Sets the default client used in every query |
|
Gets and validates the current client. If no client is provided, the global client is returned. |
Attributes
- class ClientFactory(client_id, endpoint=KASKADA_DEFAULT_ENDPOINT, is_secure=True, polling_interval_seconds=1)[source]
- Parameters:
- class Client(client_id, endpoint, is_secure, should_check_health=True, polling_interval_seconds=1.0, should_connect=True)[source]
Bases:
object
A Kaskada Client connects to the Kaskada Manager API
- Parameters:
- health_check_watcher: Optional[kaskada.health.health_check_servicer.HealthCheckServicer][source]
- connect()[source]
Attempts to connect to the manager service. The connection tries up to MAX_HEALTH_CHECK_ATTEMPTS before throwing a ConnectionError. The connection checks the health endpoint of the manager service until reporting SERVING.
- Raises:
ConnectionError – if unable to connect after MAX_HEALTH_CHECK_ATTEMPTS
- is_ready(always_check=False)[source]
Determines if the client is ready by querying the health servicer. If should_check_health is set to False, this method always returns True.
- validate()[source]
Validates the client by checking the service stubs
- Raises:
ValueError – View service stub was not initialized properly.
ValueError – Table service stubs was not initialized properly.
ValueError – Query service stubs was not initialized properly.
ValueError – Materialization service stubs was not initialized properly.
- showtraceback(_self, *_args, **_kwargs)[source]
Upates the IPython interactive shell to show tracebook
- set_default_slice(slice)[source]
Sets the default slice used in every query
- Parameters:
slice (SliceFilter) – SliceFilter to set the default
- set_default_client(client)[source]
Sets the default client used in every query
- Parameters:
client (Client) – the target client
- get_client(client=None, validate=True)[source]
Gets and validates the current client. If no client is provided, the global client is returned.
- Parameters:
- Raises:
ValueError – No client is initialized or client is improperly initialized
- Returns:
The provided client argument or the global client.
- Return type: