Skip to content

Commit e7e4ec8

Browse files
authored
Docs updates and List size constraints (#22)
1 parent 8d3ec69 commit e7e4ec8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+345
-324
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ You can install the Python package using `pip`:
3737
pip install foundry-platform-sdk
3838
```
3939

40-
Then, import the package:
41-
```python
42-
import foundry.v2
43-
```
44-
4540
<a id="major-version-link"></a>
4641
## API Versioning
4742
Every endpoint of the Foundry API is versioned using a version number that appears in the URL. For example,
@@ -86,6 +81,8 @@ You can pass in the hostname and token as keyword arguments when
8681
initializing the `UserTokenAuth`:
8782

8883
```python
84+
import foundry
85+
8986
foundry_client = foundry.v2.FoundryClient(
9087
auth=foundry.UserTokenAuth(
9188
hostname="example.palantirfoundry.com",
@@ -107,6 +104,8 @@ the sign-in process using the `sign_in_as_service_user` method. As these service
107104
automatically retry all operations one time if a `401` (Unauthorized) error is thrown after refreshing the token.
108105

109106
```python
107+
import foundry
108+
110109
auth = foundry.ConfidentialClientAuth(
111110
client_id=os.environ["CLIENT_ID"],
112111
client_secret=os.environ["CLIENT_SECRET"],
@@ -124,6 +123,8 @@ auth.sign_in_as_service_user()
124123
After creating the `ConfidentialClientAuth` object, pass it in to the `FoundryClient`,
125124

126125
```python
126+
import foundry.v2
127+
127128
foundry_client = foundry.v2.FoundryClient(auth=auth, hostname="example.palantirfoundry.com")
128129
```
129130

@@ -135,7 +136,7 @@ purposes.
135136

136137
```python
137138
from foundry.v1 import FoundryClient
138-
from foundry import PalantirRPCException
139+
import foundry
139140
from pprint import pprint
140141

141142
foundry_client = FoundryClient(
@@ -158,7 +159,7 @@ try:
158159
)
159160
print("The create response:\n")
160161
pprint(api_response)
161-
except PalantirRPCException as e:
162+
except foundry.PalantirRPCException as e:
162163
print("HTTP error when calling Branch.create: %s\n" % e)
163164

164165
```
@@ -201,7 +202,7 @@ the [Pydantic error documentation](https://docs.pydantic.dev/latest/errors/error
201202
experience. See [Static Type Analysis](#static-types) below for more information.
202203

203204
### HTTP exceptions
204-
When an HTTP error status is returned, a `PalantirRPCException` is thrown. All HTTP error exception classes inherit from `ApiException`.
205+
When an HTTP error status is returned, a `PalantirRPCException` is thrown.
205206

206207
```python
207208
from foundry import PalantirRPCException

changelog/@unreleased/pr-22.v2.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type: improvement
2+
improvement:
3+
description: |-
4+
- Docs updates including updating examples and fixing imports
5+
- Adding size constraints around List types when applicable
6+
links:
7+
- https://github.com/palantir/foundry-platform-python/pull/22

docs/v1/Datasets/Branch.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Name | Type | Description | Notes |
2929

3030
```python
3131
from foundry.v1 import FoundryClient
32-
from foundry import PalantirRPCException
32+
import foundry
3333
from pprint import pprint
3434

3535
foundry_client = FoundryClient(
@@ -52,7 +52,7 @@ try:
5252
)
5353
print("The create response:\n")
5454
pprint(api_response)
55-
except PalantirRPCException as e:
55+
except foundry.PalantirRPCException as e:
5656
print("HTTP error when calling Branch.create: %s\n" % e)
5757

5858
```
@@ -90,7 +90,7 @@ Name | Type | Description | Notes |
9090

9191
```python
9292
from foundry.v1 import FoundryClient
93-
from foundry import PalantirRPCException
93+
import foundry
9494
from pprint import pprint
9595

9696
foundry_client = FoundryClient(
@@ -110,7 +110,7 @@ try:
110110
)
111111
print("The delete response:\n")
112112
pprint(api_response)
113-
except PalantirRPCException as e:
113+
except foundry.PalantirRPCException as e:
114114
print("HTTP error when calling Branch.delete: %s\n" % e)
115115

116116
```
@@ -148,7 +148,7 @@ Name | Type | Description | Notes |
148148

149149
```python
150150
from foundry.v1 import FoundryClient
151-
from foundry import PalantirRPCException
151+
import foundry
152152
from pprint import pprint
153153

154154
foundry_client = FoundryClient(
@@ -168,7 +168,7 @@ try:
168168
)
169169
print("The get response:\n")
170170
pprint(api_response)
171-
except PalantirRPCException as e:
171+
except foundry.PalantirRPCException as e:
172172
print("HTTP error when calling Branch.get: %s\n" % e)
173173

174174
```
@@ -206,7 +206,7 @@ Name | Type | Description | Notes |
206206

207207
```python
208208
from foundry.v1 import FoundryClient
209-
from foundry import PalantirRPCException
209+
import foundry
210210
from pprint import pprint
211211

212212
foundry_client = FoundryClient(
@@ -225,7 +225,7 @@ try:
225225
page_size=page_size,
226226
):
227227
pprint(branch)
228-
except PalantirRPCException as e:
228+
except foundry.PalantirRPCException as e:
229229
print("HTTP error when calling Branch.list: %s\n" % e)
230230

231231
```
@@ -264,7 +264,7 @@ Name | Type | Description | Notes |
264264

265265
```python
266266
from foundry.v1 import FoundryClient
267-
from foundry import PalantirRPCException
267+
import foundry
268268
from pprint import pprint
269269

270270
foundry_client = FoundryClient(
@@ -287,7 +287,7 @@ try:
287287
)
288288
print("The page response:\n")
289289
pprint(api_response)
290-
except PalantirRPCException as e:
290+
except foundry.PalantirRPCException as e:
291291
print("HTTP error when calling Branch.page: %s\n" % e)
292292

293293
```

docs/v1/Datasets/Dataset.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Name | Type | Description | Notes |
2626

2727
```python
2828
from foundry.v1 import FoundryClient
29-
from foundry import PalantirRPCException
29+
import foundry
3030
from pprint import pprint
3131

3232
foundry_client = FoundryClient(
@@ -46,7 +46,7 @@ try:
4646
)
4747
print("The create response:\n")
4848
pprint(api_response)
49-
except PalantirRPCException as e:
49+
except foundry.PalantirRPCException as e:
5050
print("HTTP error when calling Dataset.create: %s\n" % e)
5151

5252
```
@@ -83,7 +83,7 @@ Name | Type | Description | Notes |
8383

8484
```python
8585
from foundry.v1 import FoundryClient
86-
from foundry import PalantirRPCException
86+
import foundry
8787
from pprint import pprint
8888

8989
foundry_client = FoundryClient(
@@ -109,7 +109,7 @@ try:
109109
)
110110
print("The delete_schema response:\n")
111111
pprint(api_response)
112-
except PalantirRPCException as e:
112+
except foundry.PalantirRPCException as e:
113113
print("HTTP error when calling Dataset.delete_schema: %s\n" % e)
114114

115115
```
@@ -146,7 +146,7 @@ Name | Type | Description | Notes |
146146

147147
```python
148148
from foundry.v1 import FoundryClient
149-
from foundry import PalantirRPCException
149+
import foundry
150150
from pprint import pprint
151151

152152
foundry_client = FoundryClient(
@@ -163,7 +163,7 @@ try:
163163
)
164164
print("The get response:\n")
165165
pprint(api_response)
166-
except PalantirRPCException as e:
166+
except foundry.PalantirRPCException as e:
167167
print("HTTP error when calling Dataset.get: %s\n" % e)
168168

169169
```
@@ -200,7 +200,7 @@ Name | Type | Description | Notes |
200200

201201
```python
202202
from foundry.v1 import FoundryClient
203-
from foundry import PalantirRPCException
203+
import foundry
204204
from pprint import pprint
205205

206206
foundry_client = FoundryClient(
@@ -226,7 +226,7 @@ try:
226226
)
227227
print("The get_schema response:\n")
228228
pprint(api_response)
229-
except PalantirRPCException as e:
229+
except foundry.PalantirRPCException as e:
230230
print("HTTP error when calling Dataset.get_schema: %s\n" % e)
231231

232232
```
@@ -271,7 +271,7 @@ Name | Type | Description | Notes |
271271

272272
```python
273273
from foundry.v1 import FoundryClient
274-
from foundry import PalantirRPCException
274+
import foundry
275275
from pprint import pprint
276276

277277
foundry_client = FoundryClient(
@@ -306,7 +306,7 @@ try:
306306
)
307307
print("The read response:\n")
308308
pprint(api_response)
309-
except PalantirRPCException as e:
309+
except foundry.PalantirRPCException as e:
310310
print("HTTP error when calling Dataset.read: %s\n" % e)
311311

312312
```
@@ -400,7 +400,7 @@ Name | Type | Description | Notes |
400400

401401
```python
402402
from foundry.v1 import FoundryClient
403-
from foundry import PalantirRPCException
403+
import foundry
404404
from pprint import pprint
405405

406406
foundry_client = FoundryClient(
@@ -426,7 +426,7 @@ try:
426426
)
427427
print("The replace_schema response:\n")
428428
pprint(api_response)
429-
except PalantirRPCException as e:
429+
except foundry.PalantirRPCException as e:
430430
print("HTTP error when calling Dataset.replace_schema: %s\n" % e)
431431

432432
```

docs/v1/Datasets/File.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Name | Type | Description | Notes |
4444

4545
```python
4646
from foundry.v1 import FoundryClient
47-
from foundry import PalantirRPCException
47+
import foundry
4848
from pprint import pprint
4949

5050
foundry_client = FoundryClient(
@@ -70,7 +70,7 @@ try:
7070
)
7171
print("The delete response:\n")
7272
pprint(api_response)
73-
except PalantirRPCException as e:
73+
except foundry.PalantirRPCException as e:
7474
print("HTTP error when calling File.delete: %s\n" % e)
7575

7676
```
@@ -132,7 +132,7 @@ Name | Type | Description | Notes |
132132

133133
```python
134134
from foundry.v1 import FoundryClient
135-
from foundry import PalantirRPCException
135+
import foundry
136136
from pprint import pprint
137137

138138
foundry_client = FoundryClient(
@@ -161,7 +161,7 @@ try:
161161
)
162162
print("The get response:\n")
163163
pprint(api_response)
164-
except PalantirRPCException as e:
164+
except foundry.PalantirRPCException as e:
165165
print("HTTP error when calling File.get: %s\n" % e)
166166

167167
```
@@ -225,7 +225,7 @@ Name | Type | Description | Notes |
225225

226226
```python
227227
from foundry.v1 import FoundryClient
228-
from foundry import PalantirRPCException
228+
import foundry
229229
from pprint import pprint
230230

231231
foundry_client = FoundryClient(
@@ -253,7 +253,7 @@ try:
253253
start_transaction_rid=start_transaction_rid,
254254
):
255255
pprint(file)
256-
except PalantirRPCException as e:
256+
except foundry.PalantirRPCException as e:
257257
print("HTTP error when calling File.list: %s\n" % e)
258258

259259
```
@@ -338,7 +338,7 @@ Name | Type | Description | Notes |
338338

339339
```python
340340
from foundry.v1 import FoundryClient
341-
from foundry import PalantirRPCException
341+
import foundry
342342
from pprint import pprint
343343

344344
foundry_client = FoundryClient(
@@ -370,7 +370,7 @@ try:
370370
)
371371
print("The page response:\n")
372372
pprint(api_response)
373-
except PalantirRPCException as e:
373+
except foundry.PalantirRPCException as e:
374374
print("HTTP error when calling File.page: %s\n" % e)
375375

376376
```
@@ -433,7 +433,7 @@ Name | Type | Description | Notes |
433433

434434
```python
435435
from foundry.v1 import FoundryClient
436-
from foundry import PalantirRPCException
436+
import foundry
437437
from pprint import pprint
438438

439439
foundry_client = FoundryClient(
@@ -462,7 +462,7 @@ try:
462462
)
463463
print("The read response:\n")
464464
pprint(api_response)
465-
except PalantirRPCException as e:
465+
except foundry.PalantirRPCException as e:
466466
print("HTTP error when calling File.read: %s\n" % e)
467467

468468
```
@@ -521,7 +521,7 @@ Name | Type | Description | Notes |
521521

522522
```python
523523
from foundry.v1 import FoundryClient
524-
from foundry import PalantirRPCException
524+
import foundry
525525
from pprint import pprint
526526

527527
foundry_client = FoundryClient(
@@ -553,7 +553,7 @@ try:
553553
)
554554
print("The upload response:\n")
555555
pprint(api_response)
556-
except PalantirRPCException as e:
556+
except foundry.PalantirRPCException as e:
557557
print("HTTP error when calling File.upload: %s\n" % e)
558558

559559
```

0 commit comments

Comments
 (0)