pltr-cli 0.9.0__py3-none-any.whl → 0.9.2__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.
- pltr/__init__.py +1 -1
- pltr/services/dataset.py +35 -7
- pltr/services/orchestration.py +1 -1
- {pltr_cli-0.9.0.dist-info → pltr_cli-0.9.2.dist-info}/METADATA +1 -1
- {pltr_cli-0.9.0.dist-info → pltr_cli-0.9.2.dist-info}/RECORD +8 -8
- {pltr_cli-0.9.0.dist-info → pltr_cli-0.9.2.dist-info}/WHEEL +0 -0
- {pltr_cli-0.9.0.dist-info → pltr_cli-0.9.2.dist-info}/entry_points.txt +0 -0
- {pltr_cli-0.9.0.dist-info → pltr_cli-0.9.2.dist-info}/licenses/LICENSE +0 -0
pltr/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.9.
|
|
1
|
+
__version__ = "0.9.2"
|
pltr/services/dataset.py
CHANGED
|
@@ -58,27 +58,55 @@ class DatasetService(BaseService):
|
|
|
58
58
|
|
|
59
59
|
def apply_schema(self, dataset_rid: str, branch: str = "master") -> Dict[str, Any]:
|
|
60
60
|
"""
|
|
61
|
-
Apply/infer schema for a dataset using
|
|
61
|
+
Apply/infer schema for a dataset using both schema inference and metadata APIs.
|
|
62
|
+
|
|
63
|
+
This method performs two sequential API calls:
|
|
64
|
+
1. Schema inference to infer the dataset schema
|
|
65
|
+
2. Schema application to apply the inferred schema to the dataset
|
|
62
66
|
|
|
63
67
|
Args:
|
|
64
68
|
dataset_rid: Dataset Resource Identifier
|
|
65
69
|
branch: Dataset branch name (default: "master")
|
|
66
70
|
|
|
67
71
|
Returns:
|
|
68
|
-
Schema
|
|
72
|
+
Schema application result including transaction and version information
|
|
69
73
|
"""
|
|
70
74
|
try:
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
# Step 1: Call schema inference API to infer the schema
|
|
76
|
+
inference_endpoint = f"/foundry-schema-inference/api/datasets/{dataset_rid}/branches/{branch}/schema"
|
|
77
|
+
inference_response = self._make_request(
|
|
78
|
+
"POST", inference_endpoint, json_data={}
|
|
79
|
+
)
|
|
73
80
|
|
|
74
|
-
# Parse the response
|
|
75
|
-
|
|
81
|
+
# Parse the inference response
|
|
82
|
+
inference_result = (
|
|
83
|
+
inference_response.json() if inference_response.text else {}
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# Extract the foundry schema from the inference result
|
|
87
|
+
foundry_schema = inference_result.get("data", {}).get("foundrySchema")
|
|
88
|
+
if not foundry_schema:
|
|
89
|
+
raise RuntimeError(
|
|
90
|
+
"Schema inference failed: No foundrySchema found in response"
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Step 2: Call foundry-metadata API to apply the schema
|
|
94
|
+
metadata_endpoint = f"/foundry-metadata/api/schemas/datasets/{dataset_rid}/branches/{branch}"
|
|
95
|
+
metadata_response = self._make_request(
|
|
96
|
+
"POST", metadata_endpoint, json_data=foundry_schema
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
# Parse the metadata response
|
|
100
|
+
metadata_result = metadata_response.json() if metadata_response.text else {}
|
|
76
101
|
|
|
77
102
|
return {
|
|
78
103
|
"dataset_rid": dataset_rid,
|
|
79
104
|
"branch": branch,
|
|
80
105
|
"status": "Schema applied successfully",
|
|
81
|
-
"
|
|
106
|
+
"inference_result": inference_result,
|
|
107
|
+
"application_result": metadata_result,
|
|
108
|
+
"transaction_rid": metadata_result.get("transactionRid"),
|
|
109
|
+
"version_id": metadata_result.get("versionId"),
|
|
82
110
|
}
|
|
83
111
|
except Exception as e:
|
|
84
112
|
raise RuntimeError(f"Failed to apply schema for dataset {dataset_rid}: {e}")
|
pltr/services/orchestration.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pltr/__init__.py,sha256=
|
|
1
|
+
pltr/__init__.py,sha256=gqT-BGoeEItda9fICQDvLbxEjWRIBhFJxPxxKvmHLUo,22
|
|
2
2
|
pltr/__main__.py,sha256=HWJ49UoAYBQCf8kjuySPmBTuUjTZrOx-y6PzMTyS1KE,879
|
|
3
3
|
pltr/cli.py,sha256=DikRsWsU7QWvRWHgB6wZIct916ebWyaub7PlAjKJXws,2664
|
|
4
4
|
pltr/auth/__init__.py,sha256=G0V-Rh25FaJsH2nhrf146XQQG_ApdbyPJNuHJC25kgk,38
|
|
@@ -33,11 +33,11 @@ pltr/services/__init__.py,sha256=zQpgrqPdAkZI-nobi33mctU2-iGNgazzvjBVY8YRbSQ,101
|
|
|
33
33
|
pltr/services/admin.py,sha256=8FjExmDeIKeVqkAxM83SVvpp_pH9W-Q33cgVs6BHxLQ,9957
|
|
34
34
|
pltr/services/base.py,sha256=JF9cyYf7njZuj1ldOLdgzIDhJjOfazBvXPNR-gKVnMY,3682
|
|
35
35
|
pltr/services/connectivity.py,sha256=34kazXhue5gNi1_2s2R5Ma4VQe6jP25CO-ztiPhCeZw,10548
|
|
36
|
-
pltr/services/dataset.py,sha256=
|
|
36
|
+
pltr/services/dataset.py,sha256=LFoK8otJ_MYqH0x5rcmNyIi5X0zr_Q8KP-zG9reArPA,45027
|
|
37
37
|
pltr/services/folder.py,sha256=mWElyvn-wXPB5sv8Ik_dLeW5JM6jZg3g9KKBk6UcrlQ,5389
|
|
38
38
|
pltr/services/mediasets.py,sha256=HgHNFWoG9r-5xupANVOxHg_h5EKsBDl6PsO8hwdbm28,9854
|
|
39
39
|
pltr/services/ontology.py,sha256=iW7qRK8ptlw-u4eAwLNC-mdzLoLZzh7SRqJyok2c3GU,14883
|
|
40
|
-
pltr/services/orchestration.py,sha256=
|
|
40
|
+
pltr/services/orchestration.py,sha256=z1lofohVNRVlKyHffo_K1-I-1f9ZqsLKxQuyUOhAGlY,14729
|
|
41
41
|
pltr/services/project.py,sha256=nwLXBX0MWgOnVQ7CAZQHnzZtSJY_hqlGyooFngQSjcc,7740
|
|
42
42
|
pltr/services/resource.py,sha256=hX1DX5ZoVx8-ZImBitHqgMS8Ver022RoMbd4ZvCt-fA,9603
|
|
43
43
|
pltr/services/resource_role.py,sha256=Ootor16c6PR9TNxe6KJyd4W2lYM_HHDxJk-JvZhgRxU,10608
|
|
@@ -48,8 +48,8 @@ pltr/utils/alias_resolver.py,sha256=DIF7P1UnUU8kqocJfIDEWjYq4s8_0KfqRZBbECeZEh8,
|
|
|
48
48
|
pltr/utils/completion.py,sha256=bjeqjleEfB2YcQFpcxvF0GoQ763F6KBbULSZC4FWY_g,4980
|
|
49
49
|
pltr/utils/formatting.py,sha256=38g3G2T5WUFKCCKo42NIBR8_Rdl4pp0ytCEZURoV3l4,50275
|
|
50
50
|
pltr/utils/progress.py,sha256=BKYbiLO61uhQbibabU7pxvvbAWMRLRmqk4pZldBQK_g,9053
|
|
51
|
-
pltr_cli-0.9.
|
|
52
|
-
pltr_cli-0.9.
|
|
53
|
-
pltr_cli-0.9.
|
|
54
|
-
pltr_cli-0.9.
|
|
55
|
-
pltr_cli-0.9.
|
|
51
|
+
pltr_cli-0.9.2.dist-info/METADATA,sha256=FUJSqLyNM9gdjT3CeD7t8VzpoXhDBY6M6MxNzJcm95U,17714
|
|
52
|
+
pltr_cli-0.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
53
|
+
pltr_cli-0.9.2.dist-info/entry_points.txt,sha256=8tvEcW04kA_oAE2Dwwu-Og9efjl4ESJvs4AzlP2KBdQ,38
|
|
54
|
+
pltr_cli-0.9.2.dist-info/licenses/LICENSE,sha256=6VUFd_ytnOBD2O1tmkKrA-smigi9QEhYr_tge4h4z8Y,1070
|
|
55
|
+
pltr_cli-0.9.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|