Skip to content

Commit fc0f873

Browse files
Update exception section of config (#196)
Co-authored-by: svc-changelog <[email protected]>
1 parent d8ffc7b commit fc0f873

File tree

29 files changed

+589
-339
lines changed

29 files changed

+589
-339
lines changed

.idea/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -208,35 +208,36 @@ the [Pydantic error documentation](https://docs.pydantic.dev/latest/errors/error
208208
experience. See [Static Type Analysis](#static-types) below for more information.
209209

210210
### HTTP exceptions
211-
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:
211+
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:
212212

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

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

219-
datasetRid: DatasetRid
219+
datasetRid: datasets_models.DatasetRid
220+
branchName: datasets_models.BranchName
220221

221222

222223
@dataclass
223-
class DatasetNotFound(NotFoundError):
224-
name: Literal["DatasetNotFound"]
225-
parameters: DatasetNotFoundParameters
224+
class BranchNotFound(errors.NotFoundError):
225+
name: typing.Literal["BranchNotFound"]
226+
parameters: BranchNotFoundParameters
226227
error_instance_id: str
227228

228229
```
229230

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

232233
```python
233-
from foundry_sdk.v2.datasets.errors import DatasetNotFound
234+
from foundry_sdk.v1.datasets.errors import BranchNotFound
234235

235236
try:
236237
response = client.datasets.Dataset.get(dataset_rid)
237238
...
238-
except DatasetNotFound as e:
239-
print("There was an error with the request", e.parameters[...])
239+
except BranchNotFound as e:
240+
print("Resource not found", e.parameters[...])
240241

241242
```
242243

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

259260
```python
260261
from foundry_sdk import PalantirRPCException
261-
from foundry_sdk import UnauthorizedError
262+
from foundry_sdk import NotFoundError
262263

263264
try:
264265
api_response = client.datasets.Dataset.get(dataset_rid)
265266
...
266-
except UnauthorizedError as e:
267-
print("There was an error with the request", e)
267+
except NotFoundError as e:
268+
print("Resource not found", e)
268269
except PalantirRPCException as e:
269270
print("Another HTTP exception occurred", e)
270271

@@ -553,6 +554,7 @@ Namespace | Resource | Operation | HTTP request |
553554
**Datasets** | Branch | [**list**](docs/v2/Datasets/Branch.md#list) | **GET** /v2/datasets/{datasetRid}/branches |
554555
**Datasets** | Dataset | [**create**](docs/v2/Datasets/Dataset.md#create) | **POST** /v2/datasets |
555556
**Datasets** | Dataset | [**get**](docs/v2/Datasets/Dataset.md#get) | **GET** /v2/datasets/{datasetRid} |
557+
**Datasets** | Dataset | [**get_schedules**](docs/v2/Datasets/Dataset.md#get_schedules) | **GET** /v2/datasets/{datasetRid}/getSchedules |
556558
**Datasets** | Dataset | [**read_table**](docs/v2/Datasets/Dataset.md#read_table) | **GET** /v2/datasets/{datasetRid}/readTable |
557559
**Datasets** | File | [**content**](docs/v2/Datasets/File.md#content) | **GET** /v2/datasets/{datasetRid}/files/{filePath}/content |
558560
**Datasets** | File | [**delete**](docs/v2/Datasets/File.md#delete) | **DELETE** /v2/datasets/{datasetRid}/files/{filePath} |
@@ -604,6 +606,7 @@ Namespace | Resource | Operation | HTTP request |
604606
**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} |
605607
**Ontologies** | AttachmentProperty | [**read_attachment**](docs/v2/Ontologies/AttachmentProperty.md#read_attachment) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/content |
606608
**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 |
609+
**Ontologies** | CipherTextProperty | [**decrypt**](docs/v2/Ontologies/CipherTextProperty.md#decrypt) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/ciphertexts/{property}/decrypt |
607610
**Ontologies** | LinkedObject | [**get_linked_object**](docs/v2/Ontologies/LinkedObject.md#get_linked_object) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/links/{linkType}/{linkedObjectPrimaryKey} |
608611
**Ontologies** | LinkedObject | [**list_linked_objects**](docs/v2/Ontologies/LinkedObject.md#list_linked_objects) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/links/{linkType} |
609612
**Ontologies** | MediaReferenceProperty | [**get_media_content**](docs/v2/Ontologies/MediaReferenceProperty.md#get_media_content) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/media/{property}/content |
@@ -999,6 +1002,7 @@ Namespace | Name | Import |
9991002
**Core** | [Reference](docs/v2/Core/models/Reference.md) | `from foundry_sdk.v2.core.models import Reference` |
10001003
**Core** | [ReleaseStatus](docs/v2/Core/models/ReleaseStatus.md) | `from foundry_sdk.v2.core.models import ReleaseStatus` |
10011004
**Core** | [RoleId](docs/v2/Core/models/RoleId.md) | `from foundry_sdk.v2.core.models import RoleId` |
1005+
**Core** | [ScheduleRid](docs/v2/Core/models/ScheduleRid.md) | `from foundry_sdk.v2.core.models import ScheduleRid` |
10021006
**Core** | [ShortType](docs/v2/Core/models/ShortType.md) | `from foundry_sdk.v2.core.models import ShortType` |
10031007
**Core** | [SizeBytes](docs/v2/Core/models/SizeBytes.md) | `from foundry_sdk.v2.core.models import SizeBytes` |
10041008
**Core** | [StreamSchema](docs/v2/Core/models/StreamSchema.md) | `from foundry_sdk.v2.core.models import StreamSchema` |
@@ -1027,6 +1031,7 @@ Namespace | Name | Import |
10271031
**Datasets** | [FileUpdatedTime](docs/v2/Datasets/models/FileUpdatedTime.md) | `from foundry_sdk.v2.datasets.models import FileUpdatedTime` |
10281032
**Datasets** | [ListBranchesResponse](docs/v2/Datasets/models/ListBranchesResponse.md) | `from foundry_sdk.v2.datasets.models import ListBranchesResponse` |
10291033
**Datasets** | [ListFilesResponse](docs/v2/Datasets/models/ListFilesResponse.md) | `from foundry_sdk.v2.datasets.models import ListFilesResponse` |
1034+
**Datasets** | [ListSchedulesResponse](docs/v2/Datasets/models/ListSchedulesResponse.md) | `from foundry_sdk.v2.datasets.models import ListSchedulesResponse` |
10301035
**Datasets** | [TableExportFormat](docs/v2/Datasets/models/TableExportFormat.md) | `from foundry_sdk.v2.datasets.models import TableExportFormat` |
10311036
**Datasets** | [Transaction](docs/v2/Datasets/models/Transaction.md) | `from foundry_sdk.v2.datasets.models import Transaction` |
10321037
**Datasets** | [TransactionCreatedTime](docs/v2/Datasets/models/TransactionCreatedTime.md) | `from foundry_sdk.v2.datasets.models import TransactionCreatedTime` |
@@ -1482,7 +1487,6 @@ Namespace | Name | Import |
14821487
**Orchestration** | [RetryCount](docs/v2/Orchestration/models/RetryCount.md) | `from foundry_sdk.v2.orchestration.models import RetryCount` |
14831488
**Orchestration** | [Schedule](docs/v2/Orchestration/models/Schedule.md) | `from foundry_sdk.v2.orchestration.models import Schedule` |
14841489
**Orchestration** | [SchedulePaused](docs/v2/Orchestration/models/SchedulePaused.md) | `from foundry_sdk.v2.orchestration.models import SchedulePaused` |
1485-
**Orchestration** | [ScheduleRid](docs/v2/Orchestration/models/ScheduleRid.md) | `from foundry_sdk.v2.orchestration.models import ScheduleRid` |
14861490
**Orchestration** | [ScheduleRun](docs/v2/Orchestration/models/ScheduleRun.md) | `from foundry_sdk.v2.orchestration.models import ScheduleRun` |
14871491
**Orchestration** | [ScheduleRunError](docs/v2/Orchestration/models/ScheduleRunError.md) | `from foundry_sdk.v2.orchestration.models import ScheduleRunError` |
14881492
**Orchestration** | [ScheduleRunErrorName](docs/v2/Orchestration/models/ScheduleRunErrorName.md) | `from foundry_sdk.v2.orchestration.models import ScheduleRunErrorName` |
@@ -1885,6 +1889,7 @@ Namespace | Name | Import |
18851889
**Datasets** | FileNotFound | `from foundry_sdk.v2.datasets.errors import FileNotFound` |
18861890
**Datasets** | FileNotFoundOnBranch | `from foundry_sdk.v2.datasets.errors import FileNotFoundOnBranch` |
18871891
**Datasets** | FileNotFoundOnTransactionRange | `from foundry_sdk.v2.datasets.errors import FileNotFoundOnTransactionRange` |
1892+
**Datasets** | GetDatasetSchedulesPermissionDenied | `from foundry_sdk.v2.datasets.errors import GetDatasetSchedulesPermissionDenied` |
18881893
**Datasets** | GetFileContentPermissionDenied | `from foundry_sdk.v2.datasets.errors import GetFileContentPermissionDenied` |
18891894
**Datasets** | InvalidBranchName | `from foundry_sdk.v2.datasets.errors import InvalidBranchName` |
18901895
**Datasets** | InvalidTransactionType | `from foundry_sdk.v2.datasets.errors import InvalidTransactionType` |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type: improvement
2+
improvement:
3+
description: Fix config error package name
4+
links:
5+
- https://github.com/palantir/foundry-platform-python/pull/196

config.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@
2626
"majorVersion": "v2",
2727
"operationName": "getDataset"
2828
},
29-
"packageName": "datasets",
30-
"errorPackageName": "datasets",
31-
"exampleError": "DatasetNotFound",
32-
"exampleGenericError": "UnauthorizedError",
33-
"exampleErrorMessage": "There was an error with the request",
29+
"packageName": "foundry_sdk",
30+
"errorPackageName": "foundry_sdk.v1.datasets.errors",
31+
"exampleError": "BranchNotFound",
32+
"exampleGenericError": "NotFoundError",
33+
"exampleErrorMessage": "Resource not found",
3434
"errorTestParameters": {
35-
"datasetRid": "ri.a.b.c.d"
35+
"datasetRid": "ri.a.b.c.d",
36+
"branchId": "main"
3637
},
3738
"errorTest2Parameters": {
38-
"datasetRid": 123
39+
"datasetRid": "ri.a.b.c.d",
40+
"branchId": 123
3941
}
4042
},
4143
"paginationExampleOperation": {

docs-snippets-npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"sls": {
2525
"dependencies": {
2626
"com.palantir.foundry.api:api-gateway": {
27-
"minVersion": "1.1149.0",
27+
"minVersion": "1.1151.0",
2828
"maxVersion": "1.x.x",
2929
"optional": false
3030
}

docs-snippets-npm/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,11 @@ export const PYTHON_PLATFORM_SNIPPETS: SdkSnippets<typeof PLATFORM_API_DOCS_SPEC
623623
"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)"
624624
}
625625
],
626+
"v2.getDatasetSchedules": [
627+
{
628+
"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)"
629+
}
630+
],
626631
"v2.readTableDataset": [
627632
{
628633
"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)"

docs/v2/Orchestration/models/ScheduleRid.md renamed to docs/v2/Core/models/ScheduleRid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ScheduleRid
22

3-
The Resource Identifier (RID) of a Schedule.
3+
The RID of a Schedule.
44

55
## Type
66
```python

docs/v2/Datasets/Dataset.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Method | HTTP request | Release Stage |
44
------------- | ------------- | ----- |
55
[**create**](#create) | **POST** /v2/datasets | Stable |
66
[**get**](#get) | **GET** /v2/datasets/{datasetRid} | Stable |
7+
[**get_schedules**](#get_schedules) | **GET** /v2/datasets/{datasetRid}/getSchedules | Public Beta |
78
[**read_table**](#read_table) | **GET** /v2/datasets/{datasetRid}/readTable | Stable |
89

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

105106
[[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)
106107

108+
# **get_schedules**
109+
Get the RIDs of the Schedules that target the given Dataset
110+
111+
112+
### Parameters
113+
114+
Name | Type | Description | Notes |
115+
------------- | ------------- | ------------- | ------------- |
116+
**dataset_rid** | DatasetRid | | |
117+
**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] |
118+
**page_size** | Optional[PageSize] | | [optional] |
119+
**page_token** | Optional[PageToken] | | [optional] |
120+
**preview** | Optional[PreviewMode] | Enables the use of preview functionality. | [optional] |
121+
122+
### Return type
123+
**ListSchedulesResponse**
124+
125+
### Example
126+
127+
```python
128+
from foundry_sdk import FoundryClient
129+
import foundry_sdk
130+
from pprint import pprint
131+
132+
client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")
133+
134+
# DatasetRid
135+
dataset_rid = None
136+
# Optional[BranchName] | The name of the Branch. If none is provided, the default Branch name - `master` for most enrollments - will be used.
137+
branch_name = None
138+
# Optional[PageSize]
139+
page_size = None
140+
# Optional[PageToken]
141+
page_token = None
142+
# Optional[PreviewMode] | Enables the use of preview functionality.
143+
preview = None
144+
145+
146+
try:
147+
for dataset in client.datasets.Dataset.get_schedules(
148+
dataset_rid,
149+
branch_name=branch_name,
150+
page_size=page_size,
151+
page_token=page_token,
152+
preview=preview,
153+
):
154+
pprint(dataset)
155+
except foundry_sdk.PalantirRPCException as e:
156+
print("HTTP error when calling Dataset.get_schedules: %s\n" % e)
157+
158+
```
159+
160+
161+
162+
### Authorization
163+
164+
See [README](../../../README.md#authorization)
165+
166+
### HTTP response details
167+
| Status Code | Type | Description | Content Type |
168+
|-------------|-------------|-------------|------------------|
169+
**200** | ListSchedulesResponse | | application/json |
170+
171+
[[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)
172+
107173
# **read_table**
108174
Gets the content of a dataset as a table in the specified format.
109175

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ListSchedulesResponse
2+
3+
ListSchedulesResponse
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**data** | List[ScheduleRid] | Yes | |
9+
**next_page_token** | Optional[PageToken] | No | |
10+
11+
12+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)

docs/v2/Ontologies/CipherTextProperty.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

77
# **decrypt**
88
Decrypt the value of a ciphertext property.

0 commit comments

Comments
 (0)