external-systems 0.105.0__py3-none-any.whl → 0.106.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of external-systems might be problematic. Click here for more details.

@@ -16,4 +16,4 @@
16
16
  # The version is set during the publishing step (since we can't know the version in advance)
17
17
  # using the autorelease bot
18
18
 
19
- __version__ = "0.105.0"
19
+ __version__ = "0.106.0"
@@ -16,6 +16,7 @@ from ._api import (
16
16
  AwsCredentials,
17
17
  ClientCertificate,
18
18
  ClientCertificateFilePaths,
19
+ GcpOauthCredentials,
19
20
  HttpsConnectionParameters,
20
21
  SourceCredentials,
21
22
  SourceParameters,
@@ -27,6 +28,7 @@ from ._sources import Source
27
28
  __all__ = [
28
29
  "ClientCertificate",
29
30
  "ClientCertificateFilePaths",
31
+ "GcpOauthCredentials",
30
32
  "HttpsConnection",
31
33
  "HttpsConnectionParameters",
32
34
  "Source",
@@ -66,8 +66,14 @@ class AwsCredentials:
66
66
  expiration: Optional[datetime] = None
67
67
 
68
68
 
69
+ @dataclass(frozen=True)
70
+ class GcpOauthCredentials:
71
+ access_token: str
72
+ expiration: Optional[datetime] = None
73
+
74
+
69
75
  # Each new credential type must include an expiration field
70
- SourceCredentials = Union[AwsCredentials]
76
+ SourceCredentials = Union[AwsCredentials, GcpOauthCredentials]
71
77
 
72
78
 
73
79
  @dataclass(frozen=True)
@@ -16,9 +16,10 @@ import logging
16
16
  import os
17
17
  import random
18
18
  import socket
19
+ import warnings
19
20
  from functools import cached_property
20
21
  from tempfile import NamedTemporaryFile
21
- from typing import Any, Mapping, Optional, Tuple
22
+ from typing import Any, Mapping, Optional, Tuple, cast
22
23
 
23
24
  import urllib3.util
24
25
  from frozendict import frozendict
@@ -192,15 +193,29 @@ class Source:
192
193
 
193
194
  def get_aws_credentials(self) -> Refreshable[AwsCredentials]:
194
195
  """
195
- Get the AWS credentials from the Source.
196
+ DEPRECATED: Use get_session_credentials instead.
197
+ """
198
+ warnings.warn(
199
+ "get_aws_credentials is deprecated and will be removed in a future release. "
200
+ "Use get_session_credentials instead.",
201
+ DeprecationWarning,
202
+ stacklevel=2,
203
+ )
204
+ if self._maybe_refreshable_resolved_source_credentials is None:
205
+ raise ValueError("Resolved source credentials are not present on the Source.")
206
+ if not isinstance(self._maybe_refreshable_resolved_source_credentials.get(), AwsCredentials):
207
+ raise ValueError("Resolved source credentials are not of type AwsCredentials.")
208
+ return cast(Refreshable[AwsCredentials], self._maybe_refreshable_resolved_source_credentials)
196
209
 
210
+ def get_session_credentials(self) -> Refreshable[SourceCredentials]:
211
+ """
197
212
  Supported Sources:
198
213
  - S3
214
+ - BigQuery
215
+ - Google Cloud Storage
199
216
  """
200
217
  if self._maybe_refreshable_resolved_source_credentials is None:
201
218
  raise ValueError("Resolved source credentials are not present on the Source.")
202
- if not isinstance(self._maybe_refreshable_resolved_source_credentials.get(), AwsCredentials):
203
- raise ValueError("Resolved source credentials are not of type AwsCredentials.")
204
219
  return self._maybe_refreshable_resolved_source_credentials
205
220
 
206
221
  def get_secret(self, key: str) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: external-systems
3
- Version: 0.105.0
3
+ Version: 0.106.0
4
4
  Summary: A Python library for interacting with Foundry Sources
5
5
  License: Apache-2.0
6
6
  Keywords: Palantir,Foundry,Sources,Compute Modules,Python Functions,Transforms
@@ -72,18 +72,21 @@ my_source: Source = ...
72
72
  some_secret: str = my_source.get_secret("SECRET_NAME")
73
73
  ```
74
74
 
75
- For sources using session credentials we support credentials generation and refresh management. Currently on an S3 source you can access session credentials using `get_aws_credentials()`. This method will throw if the source is not pre-configured with `AwsCredentials`
75
+ For sources using session credentials we support credentials generation and refresh management. This can be done by using `get_session_credentials` which supports `S3`, `BigQuery`, `Google Cloud Storage` sources.
76
76
 
77
77
  _Session credentials may not be available in all Foundry runtime environments_
78
78
 
79
79
  ```python
80
- from external_systems.sources import Source, Refreshable, AwsCredentials
80
+ from external_systems.sources import Source, Refreshable, SourceCredentials, AwsCredentials
81
81
 
82
82
  s3_source: Source = ...
83
83
 
84
- refreshable_credentials: Refreshable[AwsCredentials] = s3_source.get_aws_credentials()
84
+ refreshable_credentials: Refreshable[SourceCredentials] = s3_source.get_session_credentials()
85
85
 
86
- session_credentials: AwsCredentials = refreshable_credentials.get()
86
+ session_credentials: SourceCredentials = refreshable_credentials.get()
87
+
88
+ if not isinstance(session_credentials, AwsCredentials):
89
+ raise ...
87
90
  ```
88
91
 
89
92
  ## On-prem Connectivity with [Foundry Agent Proxy](https://www.palantir.com/docs/foundry/data-connection/agent-proxy-runtime)
@@ -1,15 +1,15 @@
1
1
  external_systems/__init__.py,sha256=xXDUDD6_qRO-nHuXZx-fXp0R0vc3N_OOsB1F5mF_kpU,651
2
- external_systems/_version.py,sha256=-N277YomEI4sXteddhJUup5RsSUv1pQb8O-9AAtDiQQ,749
2
+ external_systems/_version.py,sha256=XybDtttIh2RAnNN-6aMq9sh0VI5lwaASQ2EA1--tSg0,749
3
3
  external_systems/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- external_systems/sources/__init__.py,sha256=aqXbMIy_pnyIC1uPRzQfApLCbhYB4N8iRFnpOX4RdAk,1156
5
- external_systems/sources/_api.py,sha256=NV7oNIgzSWz4ROFW8uPpUJjDN5vfFzdTs3yKC37S39k,3262
4
+ external_systems/sources/__init__.py,sha256=QGbNcUcv8QhVJwYraMV6Q3Uy3GgZdirA8KYl6Sss2tk,1208
5
+ external_systems/sources/_api.py,sha256=7hUwW5O4v36jZnBKerHgRChSyrvHeJc4511oYBZRrGk,3400
6
6
  external_systems/sources/_connections.py,sha256=h82npEks29NALAAfMHrXcSnB7TY_OLeXgL3QN9Cssus,2509
7
7
  external_systems/sources/_proxies.py,sha256=hwgMBpOUdlhyRLgCyXE7v9X5v-1a655PDFqHJtZ9c74,6576
8
8
  external_systems/sources/_refreshable.py,sha256=0pa5XW0_2gTMW-ZymKhlhh3Kka_bWTWffThKvrTTifc,4421
9
9
  external_systems/sources/_sockets.py,sha256=XH51adVnloqg8XYVHPxl6K8R_q2BCh6WZ77cq1L8nRg,4473
10
- external_systems/sources/_sources.py,sha256=DlzoLXYtjLct1CC3h86-sfEwph5CuZe54wbhX98D9p8,11100
10
+ external_systems/sources/_sources.py,sha256=2sranCdLgb_IO8pHMPqwoGqWfmECiMro96piN6iVaZ4,11783
11
11
  external_systems/sources/_utils.py,sha256=EmUKKiKRDOZ2cZs7FZ4qCSan_lq1K_tquh3kxleB-jA,1004
12
- external_systems-0.105.0.dist-info/LICENSE.txt,sha256=NAk6Uc9K_N_J5V75k9qECpzUnO-ujT-mKK_jk_mboUE,569
13
- external_systems-0.105.0.dist-info/METADATA,sha256=y7gqCMh6BgeH4672a9ZIW0ynAagT8YBNnKna7lxB38g,4765
14
- external_systems-0.105.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
15
- external_systems-0.105.0.dist-info/RECORD,,
12
+ external_systems-0.106.0.dist-info/LICENSE.txt,sha256=NAk6Uc9K_N_J5V75k9qECpzUnO-ujT-mKK_jk_mboUE,569
13
+ external_systems-0.106.0.dist-info/METADATA,sha256=GohOFkVFmTYZ94j3folThj4TVBRKbPTEbbFYpR2UHDg,4809
14
+ external_systems-0.106.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
15
+ external_systems-0.106.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.2
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any