Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,3 @@ target/

# Ipython Notebook
.ipynb_checkpoints

.DS_Store
6 changes: 6 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ docs/ListSecretsResponse.md
docs/ListUploadsResponse.md
docs/ListWorkspaceContextsResponse.md
docs/ListWorkspacesResponse.md
docs/LoadManagedTableRequest.md
docs/LoadManagedTableResponse.md
docs/NumericProfileDetail.md
docs/QueryApi.md
docs/QueryRequest.md
Expand Down Expand Up @@ -239,6 +241,8 @@ hotdata/models/list_secrets_response.py
hotdata/models/list_uploads_response.py
hotdata/models/list_workspace_contexts_response.py
hotdata/models/list_workspaces_response.py
hotdata/models/load_managed_table_request.py
hotdata/models/load_managed_table_response.py
hotdata/models/numeric_profile_detail.py
hotdata/models/query_request.py
hotdata/models/query_response.py
Expand Down Expand Up @@ -289,4 +293,6 @@ requirements.txt
setup.cfg
test-requirements.txt
test/__init__.py
test/test_load_managed_table_request.py
test/test_load_managed_table_response.py
tox.ini
185 changes: 185 additions & 0 deletions docs/ConnectionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ Method | HTTP request | Description
[**check_connection_health**](ConnectionsApi.md#check_connection_health) | **GET** /v1/connections/{connection_id}/health | Check connection health
[**create_connection**](ConnectionsApi.md#create_connection) | **POST** /v1/connections | Create connection
[**delete_connection**](ConnectionsApi.md#delete_connection) | **DELETE** /v1/connections/{connection_id} | Delete connection
[**delete_managed_table**](ConnectionsApi.md#delete_managed_table) | **DELETE** /v1/connections/{connection_id}/schemas/{schema}/tables/{table} | Delete managed table
[**get_connection**](ConnectionsApi.md#get_connection) | **GET** /v1/connections/{connection_id} | Get connection
[**get_table_profile**](ConnectionsApi.md#get_table_profile) | **GET** /v1/connections/{connection_id}/tables/{schema}/{table}/profile | Get table profile
[**list_connections**](ConnectionsApi.md#list_connections) | **GET** /v1/connections | List connections
[**load_managed_table**](ConnectionsApi.md#load_managed_table) | **POST** /v1/connections/{connection_id}/schemas/{schema}/tables/{table}/loads | Load managed table from upload
[**purge_connection_cache**](ConnectionsApi.md#purge_connection_cache) | **DELETE** /v1/connections/{connection_id}/cache | Purge connection cache
[**purge_table_cache**](ConnectionsApi.md#purge_table_cache) | **DELETE** /v1/connections/{connection_id}/tables/{schema}/{table}/cache | Purge table cache

Expand Down Expand Up @@ -271,6 +273,94 @@ void (empty response body)

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **delete_managed_table**
> delete_managed_table(connection_id, var_schema, table)

Delete managed table

Delete a single managed-catalog table. The catalog row is removed and the backing parquet file (if any) is scheduled for deletion. Only valid against connections whose source type is `managed`.

### Example

* Api Key Authentication (WorkspaceId):
* Bearer Authentication (BearerAuth):

```python
import hotdata
from hotdata.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.hotdata.dev
# See configuration.py for a list of all supported configuration parameters.
configuration = hotdata.Configuration(
host = "https://api.hotdata.dev"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: WorkspaceId
configuration.api_key['WorkspaceId'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['WorkspaceId'] = 'Bearer'

# Configure Bearer authorization: BearerAuth
configuration = hotdata.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hotdata.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hotdata.ConnectionsApi(api_client)
connection_id = 'connection_id_example' # str | Connection ID
var_schema = 'var_schema_example' # str | Schema name
table = 'table_example' # str | Table name

try:
# Delete managed table
api_instance.delete_managed_table(connection_id, var_schema, table)
except Exception as e:
print("Exception when calling ConnectionsApi->delete_managed_table: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**connection_id** | **str**| Connection ID |
**var_schema** | **str**| Schema name |
**table** | **str**| Table name |

### Return type

void (empty response body)

### Authorization

[WorkspaceId](../README.md#WorkspaceId), [BearerAuth](../README.md#BearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | Managed table deleted | - |
**400** | Connection is not a managed catalog | - |
**404** | Connection or table not found | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_connection**
> GetConnectionResponse get_connection(connection_id)

Expand Down Expand Up @@ -528,6 +618,101 @@ This endpoint does not need any parameter.

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **load_managed_table**
> LoadManagedTableResponse load_managed_table(connection_id, var_schema, table, load_managed_table_request)

Load managed table from upload

Publish a previously-uploaded parquet file as the new generation of a managed table. The upload must reference a parquet file (verified by magic bytes). Only `mode = "replace"` is supported. Concurrent loads against the same upload return 409.

### Example

* Api Key Authentication (WorkspaceId):
* Bearer Authentication (BearerAuth):

```python
import hotdata
from hotdata.models.load_managed_table_request import LoadManagedTableRequest
from hotdata.models.load_managed_table_response import LoadManagedTableResponse
from hotdata.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.hotdata.dev
# See configuration.py for a list of all supported configuration parameters.
configuration = hotdata.Configuration(
host = "https://api.hotdata.dev"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: WorkspaceId
configuration.api_key['WorkspaceId'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['WorkspaceId'] = 'Bearer'

# Configure Bearer authorization: BearerAuth
configuration = hotdata.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hotdata.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hotdata.ConnectionsApi(api_client)
connection_id = 'connection_id_example' # str | Connection ID
var_schema = 'var_schema_example' # str | Schema name
table = 'table_example' # str | Table name
load_managed_table_request = hotdata.LoadManagedTableRequest() # LoadManagedTableRequest |

try:
# Load managed table from upload
api_response = api_instance.load_managed_table(connection_id, var_schema, table, load_managed_table_request)
print("The response of ConnectionsApi->load_managed_table:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ConnectionsApi->load_managed_table: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**connection_id** | **str**| Connection ID |
**var_schema** | **str**| Schema name |
**table** | **str**| Table name |
**load_managed_table_request** | [**LoadManagedTableRequest**](LoadManagedTableRequest.md)| |

### Return type

[**LoadManagedTableResponse**](LoadManagedTableResponse.md)

### Authorization

[WorkspaceId](../README.md#WorkspaceId), [BearerAuth](../README.md#BearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Managed table loaded | - |
**400** | Invalid request (bad mode, non-managed connection, bad parquet) | - |
**404** | Connection or upload not found | - |
**409** | Upload already consumed or in flight | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **purge_connection_cache**
> purge_connection_cache(connection_id)

Expand Down
31 changes: 31 additions & 0 deletions docs/LoadManagedTableRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# LoadManagedTableRequest

Request body for `POST /v1/connections/{connection_id}/schemas/{schema}/tables/{table}/loads`. Publishes a previously-uploaded parquet file as the new generation for the named managed table. `mode` is fixed to `\"replace\"` today; the field is kept in the request body so future modes (e.g. append) are an additive change.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mode** | **str** | Load mode. Only `\"replace\"` is supported in this release. |
**upload_id** | **str** | ID of a previously-staged upload (see `POST /v1/files`). The upload must reference a parquet file. The upload is claimed atomically; concurrent loads against the same `upload_id` return 409. |

## Example

```python
from hotdata.models.load_managed_table_request import LoadManagedTableRequest

# TODO update the JSON string below
json = "{}"
# create an instance of LoadManagedTableRequest from a JSON string
load_managed_table_request_instance = LoadManagedTableRequest.from_json(json)
# print the JSON string representation of the object
print(LoadManagedTableRequest.to_json())

# convert the object into a dict
load_managed_table_request_dict = load_managed_table_request_instance.to_dict()
# create an instance of LoadManagedTableRequest from a dict
load_managed_table_request_from_dict = LoadManagedTableRequest.from_dict(load_managed_table_request_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


34 changes: 34 additions & 0 deletions docs/LoadManagedTableResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# LoadManagedTableResponse

Response body for `POST /v1/connections/{connection_id}/schemas/{schema}/tables/{table}/loads`.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrow_schema_json** | **str** | Arrow schema (JSON) parsed from the uploaded parquet footer. |
**connection_id** | **str** | |
**row_count** | **int** | Total rows in the published parquet file. |
**schema_name** | **str** | |
**table_name** | **str** | |

## Example

```python
from hotdata.models.load_managed_table_response import LoadManagedTableResponse

# TODO update the JSON string below
json = "{}"
# create an instance of LoadManagedTableResponse from a JSON string
load_managed_table_response_instance = LoadManagedTableResponse.from_json(json)
# print the JSON string representation of the object
print(LoadManagedTableResponse.to_json())

# convert the object into a dict
load_managed_table_response_dict = load_managed_table_response_instance.to_dict()
# create an instance of LoadManagedTableResponse from a dict
load_managed_table_response_from_dict = LoadManagedTableResponse.from_dict(load_managed_table_response_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


4 changes: 4 additions & 0 deletions hotdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@
"ListUploadsResponse",
"ListWorkspaceContextsResponse",
"ListWorkspacesResponse",
"LoadManagedTableRequest",
"LoadManagedTableResponse",
"NumericProfileDetail",
"QueryRequest",
"QueryResponse",
Expand Down Expand Up @@ -280,6 +282,8 @@
from hotdata.models.list_uploads_response import ListUploadsResponse as ListUploadsResponse
from hotdata.models.list_workspace_contexts_response import ListWorkspaceContextsResponse as ListWorkspaceContextsResponse
from hotdata.models.list_workspaces_response import ListWorkspacesResponse as ListWorkspacesResponse
from hotdata.models.load_managed_table_request import LoadManagedTableRequest as LoadManagedTableRequest
from hotdata.models.load_managed_table_response import LoadManagedTableResponse as LoadManagedTableResponse
from hotdata.models.numeric_profile_detail import NumericProfileDetail as NumericProfileDetail
from hotdata.models.query_request import QueryRequest as QueryRequest
from hotdata.models.query_response import QueryResponse as QueryResponse
Expand Down
Loading