Install & Compatibility
Where this runs
tested against v2.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.569s · 27.8MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.2s · import 0.494s · 28MB
26MB installed
● package 26MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RocksetClient
✓ from rockset import RocksetClient
✗ from rockset import Client
The main client class was renamed from 'Client' to 'RocksetClient' in v1.0.0.
Regions
✓ from rockset import Regions
Configuration
✓ from rockset import Configuration
Initializes the Rockset client using an API key from an environment variable and attempts to list workspaces and create an API key. Note that this code will not function as Rockset's public services have been shut down.
import os
from rockset import RocksetClient, Regions, ApiException
# Rockset services were shut down in June 2024. This code is for archival/demonstration only.
# Ensure ROCKSET_API_KEY is set in your environment variables if attempting to run against a hypothetical Rockset instance.
api_key = os.environ.get('ROCKSET_API_KEY', 'YOUR_ROCKSET_API_KEY')
if api_key == 'YOUR_ROCKSET_API_KEY':
print("WARNING: ROCKSET_API_KEY environment variable not set. Using placeholder.")
try:
# Initialize the Rockset client
# The host parameter replaced 'api_server' in v1.0.0
rs = RocksetClient(host=Regions.use1a1, api_key=api_key)
# Example: List workspaces
print("Attempting to list workspaces...")
workspaces = rs.Workspaces.list_all()
print(f"Found {len(workspaces)} workspaces:")
for ws in workspaces:
print(f"- {ws.name}")
# Example: Create an API key (demonstration, real usage should handle existing keys)
# This operation will likely fail as the service is offline.
try:
new_api_key_name = "my-test-api-key"
print(f"\nAttempting to create API key: {new_api_key_name}...")
created_key = rs.APIKeys.create(name=new_api_key_name, role="member")
print(f"Successfully created API key: {created_key.name}")
except ApiException as e:
print(f"Could not create API key (expected due to service shutdown): {e}")
except ApiException as e:
print(f"An API error occurred: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingRockset's public cloud service was shut down in June 2024 following its acquisition by OpenAI. The Python client library is no longer functional for connecting to a live Rockset service.fixNo direct fix; the underlying service is unavailable. The library is for archival/historical purposes.
affects: All versions post-June 2024
breakingMigration from v0 to v1 of the client library introduced breaking changes. The main client class was renamed from `Client` to `RocksetClient`, the `api_server` parameter for specifying the API location was changed to `host`, and the query builder was deprecated. Some endpoints and parameters were also renamed.fixUpdate client instantiation from `Client(api_server=...)` to `RocksetClient(host=...)`. Review endpoint and parameter names in the updated documentation for v1.
affects: <1.0.0 to >=1.0.0
gotchaUsers may encounter SSL errors when using the client, potentially due to Python installation issues.fixSet environment variables: `CERT_PATH=$(python3 -m certifi); export SSL_CERT_FILE=${CERT_PATH}; export REQUESTS_CA_BUNDLE=${CERT_PATH}`. As a last resort, SSL verification can be disabled via `config.verify_ssl = False`, but this is not recommended for production. affects: All versions
gotchaWhen making requests, certain parameters often expect instances of `rockset.models` classes (e.g., `rockset.models.QueryRequestSql`). For brevity, you can often pass a dictionary instead of instantiating the model object directly.fixInstead of `QueryRequestSql(sql='SELECT * FROM my_collection')`, use `{'sql': 'SELECT * FROM my_collection'}`. affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'rockset'
The `rockset` library is not installed in the current Python environment.
fixRun `pip install rockset` to install the library.
NameError: name 'Client' is not defined
Attempting to use the old client class name `Client` after upgrading to v1.0.0 or later, where it was renamed.
fixChange `Client` to `RocksetClient`. Ensure you import it with `from rockset import RocksetClient`.
rockset.ApiException: (401)
Reason: Unauthorized
The provided API key is invalid, missing, or lacks the necessary permissions, or the service is no longer available.
fixVerify that your `ROCKSET_API_KEY` is correct and has appropriate permissions. Given the service shutdown, this error is now expected.
TypeError: __init__() got an unexpected keyword argument 'api_server'
Attempting to use the old `api_server` parameter for host configuration with `RocksetClient` (v1.0.0+).
fixReplace `api_server` with `host`. Example: `RocksetClient(host=Regions.use1a1, api_key=...)`.
Upgrade
Version history
2.1.2latest on PyPI · released May 2, 2024
Audit
Dependencies
pythonrequiredRequired Python version range for the library.