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
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,35 +208,36 @@ the [Pydantic error documentation](https://docs.pydantic.dev/latest/errors/error
experience. See [Static Type Analysis](#static-types) below for more information.

### HTTP exceptions
Each operation includes a list of possible exceptions that can be thrown which can be thrown by the server, all of which inherit from `PalantirRPCException`. For example, an operation that interacts with datasets might throw a `DatasetNotFound` error, which is defined as follows:
Each operation includes a list of possible exceptions that can be thrown which can be thrown by the server, all of which inherit from `PalantirRPCException`. For example, an operation that interacts with dataset branches might throw a `BranchNotFound` error, which is defined as follows:

```python
class DatasetNotFoundParameters(TypedDict):
"""The given Dataset could not be found."""
class BranchNotFoundParameters(typing_extensions.TypedDict):
"""The requested branch could not be found, or the client token does not have access to it."""

__pydantic_config__ = {"extra": "allow"} # type: ignore

datasetRid: DatasetRid
datasetRid: datasets_models.DatasetRid
branchName: datasets_models.BranchName


@dataclass
class DatasetNotFound(NotFoundError):
name: Literal["DatasetNotFound"]
parameters: DatasetNotFoundParameters
class BranchNotFound(errors.NotFoundError):
name: typing.Literal["BranchNotFound"]
parameters: BranchNotFoundParameters
error_instance_id: str

```

As a user, you can catch this exception and handle it accordingly.

```python
from foundry_sdk.v2.datasets.errors import DatasetNotFound
from foundry_sdk.v1.datasets.errors import BranchNotFound

try:
response = client.datasets.Dataset.get(dataset_rid)
...
except DatasetNotFound as e:
print("There was an error with the request", e.parameters[...])
except BranchNotFound as e:
print("Resource not found", e.parameters[...])

```

Expand All @@ -258,13 +259,13 @@ catch a generic subclass of `PalantirRPCException` such as `BadRequestError` or

```python
from foundry_sdk import PalantirRPCException
from foundry_sdk import UnauthorizedError
from foundry_sdk import NotFoundError

try:
api_response = client.datasets.Dataset.get(dataset_rid)
...
except UnauthorizedError as e:
print("There was an error with the request", e)
except NotFoundError as e:
print("Resource not found", e)
except PalantirRPCException as e:
print("Another HTTP exception occurred", e)

Expand Down Expand Up @@ -553,6 +554,7 @@ Namespace | Resource | Operation | HTTP request |
**Datasets** | Branch | [**list**](docs/v2/Datasets/Branch.md#list) | **GET** /v2/datasets/{datasetRid}/branches |
**Datasets** | Dataset | [**create**](docs/v2/Datasets/Dataset.md#create) | **POST** /v2/datasets |
**Datasets** | Dataset | [**get**](docs/v2/Datasets/Dataset.md#get) | **GET** /v2/datasets/{datasetRid} |
**Datasets** | Dataset | [**get_schedules**](docs/v2/Datasets/Dataset.md#get_schedules) | **GET** /v2/datasets/{datasetRid}/getSchedules |
**Datasets** | Dataset | [**read_table**](docs/v2/Datasets/Dataset.md#read_table) | **GET** /v2/datasets/{datasetRid}/readTable |
**Datasets** | File | [**content**](docs/v2/Datasets/File.md#content) | **GET** /v2/datasets/{datasetRid}/files/{filePath}/content |
**Datasets** | File | [**delete**](docs/v2/Datasets/File.md#delete) | **DELETE** /v2/datasets/{datasetRid}/files/{filePath} |
Expand Down Expand Up @@ -604,6 +606,7 @@ Namespace | Resource | Operation | HTTP request |
**Ontologies** | AttachmentProperty | [**get_attachment_by_rid**](docs/v2/Ontologies/AttachmentProperty.md#get_attachment_by_rid) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/{attachmentRid} |
**Ontologies** | AttachmentProperty | [**read_attachment**](docs/v2/Ontologies/AttachmentProperty.md#read_attachment) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/content |
**Ontologies** | AttachmentProperty | [**read_attachment_by_rid**](docs/v2/Ontologies/AttachmentProperty.md#read_attachment_by_rid) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/{attachmentRid}/content |
**Ontologies** | CipherTextProperty | [**decrypt**](docs/v2/Ontologies/CipherTextProperty.md#decrypt) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/ciphertexts/{property}/decrypt |
**Ontologies** | LinkedObject | [**get_linked_object**](docs/v2/Ontologies/LinkedObject.md#get_linked_object) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/links/{linkType}/{linkedObjectPrimaryKey} |
**Ontologies** | LinkedObject | [**list_linked_objects**](docs/v2/Ontologies/LinkedObject.md#list_linked_objects) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/links/{linkType} |
**Ontologies** | MediaReferenceProperty | [**get_media_content**](docs/v2/Ontologies/MediaReferenceProperty.md#get_media_content) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/media/{property}/content |
Expand Down Expand Up @@ -999,6 +1002,7 @@ Namespace | Name | Import |
**Core** | [Reference](docs/v2/Core/models/Reference.md) | `from foundry_sdk.v2.core.models import Reference` |
**Core** | [ReleaseStatus](docs/v2/Core/models/ReleaseStatus.md) | `from foundry_sdk.v2.core.models import ReleaseStatus` |
**Core** | [RoleId](docs/v2/Core/models/RoleId.md) | `from foundry_sdk.v2.core.models import RoleId` |
**Core** | [ScheduleRid](docs/v2/Core/models/ScheduleRid.md) | `from foundry_sdk.v2.core.models import ScheduleRid` |
**Core** | [ShortType](docs/v2/Core/models/ShortType.md) | `from foundry_sdk.v2.core.models import ShortType` |
**Core** | [SizeBytes](docs/v2/Core/models/SizeBytes.md) | `from foundry_sdk.v2.core.models import SizeBytes` |
**Core** | [StreamSchema](docs/v2/Core/models/StreamSchema.md) | `from foundry_sdk.v2.core.models import StreamSchema` |
Expand Down Expand Up @@ -1027,6 +1031,7 @@ Namespace | Name | Import |
**Datasets** | [FileUpdatedTime](docs/v2/Datasets/models/FileUpdatedTime.md) | `from foundry_sdk.v2.datasets.models import FileUpdatedTime` |
**Datasets** | [ListBranchesResponse](docs/v2/Datasets/models/ListBranchesResponse.md) | `from foundry_sdk.v2.datasets.models import ListBranchesResponse` |
**Datasets** | [ListFilesResponse](docs/v2/Datasets/models/ListFilesResponse.md) | `from foundry_sdk.v2.datasets.models import ListFilesResponse` |
**Datasets** | [ListSchedulesResponse](docs/v2/Datasets/models/ListSchedulesResponse.md) | `from foundry_sdk.v2.datasets.models import ListSchedulesResponse` |
**Datasets** | [TableExportFormat](docs/v2/Datasets/models/TableExportFormat.md) | `from foundry_sdk.v2.datasets.models import TableExportFormat` |
**Datasets** | [Transaction](docs/v2/Datasets/models/Transaction.md) | `from foundry_sdk.v2.datasets.models import Transaction` |
**Datasets** | [TransactionCreatedTime](docs/v2/Datasets/models/TransactionCreatedTime.md) | `from foundry_sdk.v2.datasets.models import TransactionCreatedTime` |
Expand Down Expand Up @@ -1482,7 +1487,6 @@ Namespace | Name | Import |
**Orchestration** | [RetryCount](docs/v2/Orchestration/models/RetryCount.md) | `from foundry_sdk.v2.orchestration.models import RetryCount` |
**Orchestration** | [Schedule](docs/v2/Orchestration/models/Schedule.md) | `from foundry_sdk.v2.orchestration.models import Schedule` |
**Orchestration** | [SchedulePaused](docs/v2/Orchestration/models/SchedulePaused.md) | `from foundry_sdk.v2.orchestration.models import SchedulePaused` |
**Orchestration** | [ScheduleRid](docs/v2/Orchestration/models/ScheduleRid.md) | `from foundry_sdk.v2.orchestration.models import ScheduleRid` |
**Orchestration** | [ScheduleRun](docs/v2/Orchestration/models/ScheduleRun.md) | `from foundry_sdk.v2.orchestration.models import ScheduleRun` |
**Orchestration** | [ScheduleRunError](docs/v2/Orchestration/models/ScheduleRunError.md) | `from foundry_sdk.v2.orchestration.models import ScheduleRunError` |
**Orchestration** | [ScheduleRunErrorName](docs/v2/Orchestration/models/ScheduleRunErrorName.md) | `from foundry_sdk.v2.orchestration.models import ScheduleRunErrorName` |
Expand Down Expand Up @@ -1885,6 +1889,7 @@ Namespace | Name | Import |
**Datasets** | FileNotFound | `from foundry_sdk.v2.datasets.errors import FileNotFound` |
**Datasets** | FileNotFoundOnBranch | `from foundry_sdk.v2.datasets.errors import FileNotFoundOnBranch` |
**Datasets** | FileNotFoundOnTransactionRange | `from foundry_sdk.v2.datasets.errors import FileNotFoundOnTransactionRange` |
**Datasets** | GetDatasetSchedulesPermissionDenied | `from foundry_sdk.v2.datasets.errors import GetDatasetSchedulesPermissionDenied` |
**Datasets** | GetFileContentPermissionDenied | `from foundry_sdk.v2.datasets.errors import GetFileContentPermissionDenied` |
**Datasets** | InvalidBranchName | `from foundry_sdk.v2.datasets.errors import InvalidBranchName` |
**Datasets** | InvalidTransactionType | `from foundry_sdk.v2.datasets.errors import InvalidTransactionType` |
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-196.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Fix config error package name
links:
- https://github.com/palantir/foundry-platform-python/pull/196
16 changes: 9 additions & 7 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@
"majorVersion": "v2",
"operationName": "getDataset"
},
"packageName": "datasets",
"errorPackageName": "datasets",
"exampleError": "DatasetNotFound",
"exampleGenericError": "UnauthorizedError",
"exampleErrorMessage": "There was an error with the request",
"packageName": "foundry_sdk",
"errorPackageName": "foundry_sdk.v1.datasets.errors",
"exampleError": "BranchNotFound",
"exampleGenericError": "NotFoundError",
"exampleErrorMessage": "Resource not found",
"errorTestParameters": {
"datasetRid": "ri.a.b.c.d"
"datasetRid": "ri.a.b.c.d",
"branchId": "main"
},
"errorTest2Parameters": {
"datasetRid": 123
"datasetRid": "ri.a.b.c.d",
"branchId": 123
}
},
"paginationExampleOperation": {
Expand Down
2 changes: 1 addition & 1 deletion docs-snippets-npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"sls": {
"dependencies": {
"com.palantir.foundry.api:api-gateway": {
"minVersion": "1.1149.0",
"minVersion": "1.1151.0",
"maxVersion": "1.x.x",
"optional": false
}
Expand Down
5 changes: 5 additions & 0 deletions docs-snippets-npm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,11 @@ export const PYTHON_PLATFORM_SNIPPETS: SdkSnippets<typeof PLATFORM_API_DOCS_SPEC
"template": "from foundry_sdk import FoundryClient\nimport foundry_sdk\nfrom pprint import pprint\n\nclient = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname=\"example.palantirfoundry.com\")\n\n# DatasetRid\ndataset_rid = None\n\n\ntry:\n api_response = client.datasets.Dataset.get(dataset_rid)\n print(\"The get response:\\n\")\n pprint(api_response)\nexcept foundry_sdk.PalantirRPCException as e:\n print(\"HTTP error when calling Dataset.get: %s\\n\" % e)"
}
],
"v2.getDatasetSchedules": [
{
"template": "from foundry_sdk import FoundryClient\nimport foundry_sdk\nfrom pprint import pprint\n\nclient = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname=\"example.palantirfoundry.com\")\n\n# DatasetRid\ndataset_rid = None\n# Optional[BranchName] | The name of the Branch. If none is provided, the default Branch name - `master` for most enrollments - will be used.\nbranch_name = None\n# Optional[PageSize]\npage_size = None\n# Optional[PageToken]\npage_token = None\n# Optional[PreviewMode] | Enables the use of preview functionality.\npreview = None\n\n\ntry:\n for dataset in client.datasets.Dataset.get_schedules(\n dataset_rid,\n branch_name=branch_name,\n page_size=page_size,\n page_token=page_token,\n preview=preview,\n ):\n pprint(dataset)\nexcept foundry_sdk.PalantirRPCException as e:\n print(\"HTTP error when calling Dataset.get_schedules: %s\\n\" % e)"
}
],
"v2.readTableDataset": [
{
"template": "from foundry_sdk import FoundryClient\nimport foundry_sdk\nfrom pprint import pprint\n\nclient = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname=\"example.palantirfoundry.com\")\n\n# DatasetRid\ndataset_rid = None\n# TableExportFormat | The export format. Must be `ARROW` or `CSV`.\nformat = None\n# Optional[BranchName] | The name of the Branch.\nbranch_name = None\n# Optional[List[str]] | A subset of the dataset columns to include in the result. Defaults to all columns.\ncolumns = [\"id\", \"firstName\", \"lastName\"]\n# Optional[TransactionRid] | The Resource Identifier (RID) of the end Transaction.\nend_transaction_rid = None\n# Optional[int] | A limit on the number of rows to return. Note that row ordering is non-deterministic.\nrow_limit = None\n# Optional[TransactionRid] | The Resource Identifier (RID) of the start Transaction.\nstart_transaction_rid = None\n\n\ntry:\n api_response = client.datasets.Dataset.read_table(\n dataset_rid,\n format=format,\n branch_name=branch_name,\n columns=columns,\n end_transaction_rid=end_transaction_rid,\n row_limit=row_limit,\n start_transaction_rid=start_transaction_rid,\n )\n print(\"The read_table response:\\n\")\n pprint(api_response)\nexcept foundry_sdk.PalantirRPCException as e:\n print(\"HTTP error when calling Dataset.read_table: %s\\n\" % e)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ScheduleRid

The Resource Identifier (RID) of a Schedule.
The RID of a Schedule.

## Type
```python
Expand Down
66 changes: 66 additions & 0 deletions docs/v2/Datasets/Dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Method | HTTP request | Release Stage |
------------- | ------------- | ----- |
[**create**](#create) | **POST** /v2/datasets | Stable |
[**get**](#get) | **GET** /v2/datasets/{datasetRid} | Stable |
[**get_schedules**](#get_schedules) | **GET** /v2/datasets/{datasetRid}/getSchedules | Public Beta |
[**read_table**](#read_table) | **GET** /v2/datasets/{datasetRid}/readTable | Stable |

# **create**
Expand Down Expand Up @@ -104,6 +105,71 @@ See [README](../../../README.md#authorization)

[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v2-link) [[Back to Model list]](../../../README.md#models-v2-link) [[Back to README]](../../../README.md)

# **get_schedules**
Get the RIDs of the Schedules that target the given Dataset


### Parameters

Name | Type | Description | Notes |
------------- | ------------- | ------------- | ------------- |
**dataset_rid** | DatasetRid | | |
**branch_name** | Optional[BranchName] | The name of the Branch. If none is provided, the default Branch name - `master` for most enrollments - will be used. | [optional] |
**page_size** | Optional[PageSize] | | [optional] |
**page_token** | Optional[PageToken] | | [optional] |
**preview** | Optional[PreviewMode] | Enables the use of preview functionality. | [optional] |

### Return type
**ListSchedulesResponse**

### Example

```python
from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# DatasetRid
dataset_rid = None
# Optional[BranchName] | The name of the Branch. If none is provided, the default Branch name - `master` for most enrollments - will be used.
branch_name = None
# Optional[PageSize]
page_size = None
# Optional[PageToken]
page_token = None
# Optional[PreviewMode] | Enables the use of preview functionality.
preview = None


try:
for dataset in client.datasets.Dataset.get_schedules(
dataset_rid,
branch_name=branch_name,
page_size=page_size,
page_token=page_token,
preview=preview,
):
pprint(dataset)
except foundry_sdk.PalantirRPCException as e:
print("HTTP error when calling Dataset.get_schedules: %s\n" % e)

```



### Authorization

See [README](../../../README.md#authorization)

### HTTP response details
| Status Code | Type | Description | Content Type |
|-------------|-------------|-------------|------------------|
**200** | ListSchedulesResponse | | application/json |

[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v2-link) [[Back to Model list]](../../../README.md#models-v2-link) [[Back to README]](../../../README.md)

# **read_table**
Gets the content of a dataset as a table in the specified format.

Expand Down
12 changes: 12 additions & 0 deletions docs/v2/Datasets/models/ListSchedulesResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ListSchedulesResponse

ListSchedulesResponse

## Properties
| Name | Type | Required | Description |
| ------------ | ------------- | ------------- | ------------- |
**data** | List[ScheduleRid] | Yes | |
**next_page_token** | Optional[PageToken] | No | |


[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
2 changes: 1 addition & 1 deletion docs/v2/Ontologies/CipherTextProperty.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Method | HTTP request | Release Stage |
------------- | ------------- | ----- |
[**decrypt**](#decrypt) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/ciphertexts/{property}/decrypt | Private Beta |
[**decrypt**](#decrypt) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/ciphertexts/{property}/decrypt | Public Beta |

# **decrypt**
Decrypt the value of a ciphertext property.
Expand Down
2 changes: 1 addition & 1 deletion docs/v2/Ontologies/OntologyObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ to filter objects based on the specified query. The supported queries are:
| not | The sub-query does not match. | N/A (applied on a query) |
| and | All the sub-queries match. | N/A (applied on queries) |
| or | At least one of the sub-queries match. | N/A (applied on queries) |
| startsWith | The provided property starts with the provided term. | string |
| containsAllTermsInOrderPrefixLastTerm | The provided property contains all the terms provided in order. The last term can be a partial prefix match. | string |
| containsAllTermsInOrder | The provided property contains the provided term as a substring. | string |
| containsAnyTerm | The provided property contains at least one of the terms separated by whitespace. | string |
| containsAllTerms | The provided property contains all the terms separated by whitespace. | string |
| startsWith | Deprecated alias for containsAllTermsInOrderPrefixLastTerm. | string |

Queries can be at most three levels deep. By default, terms are separated by whitespace or punctuation (`?!,:;-[](){}'"~`). Periods (`.`) on their own are ignored.
Partial terms are not matched by terms filters except where explicitly noted.
Expand Down
1 change: 1 addition & 0 deletions docs/v2/Ontologies/models/StartsWithQuery.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# StartsWithQuery

Deprecated alias for `containsAllTermsInOrderPrefixLastTerm`, which is preferred because the name `startsWith` is misleading.
Returns objects where the specified field starts with the provided value. Allows you to specify a property to
query on by a variety of means. Either `field` or `propertyIdentifier` must be supplied, but not both.

Expand Down
2 changes: 1 addition & 1 deletion foundry_sdk/_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# using the autorelease bot
__version__ = "0.0.0"

__openapi_document_version__ = "1.1149.0"
__openapi_document_version__ = "1.1151.0"
Loading