pltr-cli 0.5.1__py3-none-any.whl → 0.5.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 +29 -130
- {pltr_cli-0.5.1.dist-info → pltr_cli-0.5.2.dist-info}/METADATA +1 -1
- {pltr_cli-0.5.1.dist-info → pltr_cli-0.5.2.dist-info}/RECORD +7 -7
- {pltr_cli-0.5.1.dist-info → pltr_cli-0.5.2.dist-info}/WHEEL +0 -0
- {pltr_cli-0.5.1.dist-info → pltr_cli-0.5.2.dist-info}/entry_points.txt +0 -0
- {pltr_cli-0.5.1.dist-info → pltr_cli-0.5.2.dist-info}/licenses/LICENSE +0 -0
pltr/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.5.
|
|
1
|
+
__version__ = "0.5.2"
|
pltr/services/dataset.py
CHANGED
|
@@ -149,14 +149,12 @@ class DatasetService(BaseService):
|
|
|
149
149
|
raise FileNotFoundError(f"File not found: {file_path}")
|
|
150
150
|
|
|
151
151
|
try:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
transaction_rid=transaction_rid,
|
|
159
|
-
)
|
|
152
|
+
result = self.service.Dataset.File.upload(
|
|
153
|
+
dataset_rid=dataset_rid,
|
|
154
|
+
file_path=str(file_path),
|
|
155
|
+
branch_name=branch,
|
|
156
|
+
transaction_rid=transaction_rid,
|
|
157
|
+
)
|
|
160
158
|
|
|
161
159
|
return {
|
|
162
160
|
"dataset_rid": dataset_rid,
|
|
@@ -196,8 +194,8 @@ class DatasetService(BaseService):
|
|
|
196
194
|
# Ensure output directory exists
|
|
197
195
|
output_path.parent.mkdir(parents=True, exist_ok=True)
|
|
198
196
|
|
|
199
|
-
file_content = self.service.
|
|
200
|
-
dataset_rid=dataset_rid, file_path=file_path,
|
|
197
|
+
file_content = self.service.Dataset.File.read(
|
|
198
|
+
dataset_rid=dataset_rid, file_path=file_path, branch_name=branch
|
|
201
199
|
)
|
|
202
200
|
|
|
203
201
|
# Write file content to disk
|
|
@@ -236,7 +234,9 @@ class DatasetService(BaseService):
|
|
|
236
234
|
List of file information dictionaries
|
|
237
235
|
"""
|
|
238
236
|
try:
|
|
239
|
-
files = self.service.
|
|
237
|
+
files = self.service.Dataset.File.list(
|
|
238
|
+
dataset_rid=dataset_rid, branch_name=branch
|
|
239
|
+
)
|
|
240
240
|
|
|
241
241
|
return [
|
|
242
242
|
{
|
|
@@ -322,11 +322,11 @@ class DatasetService(BaseService):
|
|
|
322
322
|
Transaction information dictionary
|
|
323
323
|
"""
|
|
324
324
|
try:
|
|
325
|
-
#
|
|
326
|
-
transaction = self.service.Dataset.
|
|
325
|
+
# Use the v2 API's Dataset.Transaction.create method
|
|
326
|
+
transaction = self.service.Dataset.Transaction.create(
|
|
327
327
|
dataset_rid=dataset_rid,
|
|
328
|
-
branch=branch,
|
|
329
328
|
transaction_type=transaction_type,
|
|
329
|
+
branch_name=branch,
|
|
330
330
|
)
|
|
331
331
|
|
|
332
332
|
return {
|
|
@@ -338,27 +338,6 @@ class DatasetService(BaseService):
|
|
|
338
338
|
"created_time": getattr(transaction, "created_time", None),
|
|
339
339
|
"created_by": getattr(transaction, "created_by", None),
|
|
340
340
|
}
|
|
341
|
-
except AttributeError:
|
|
342
|
-
# Fallback to service.create_transaction if available
|
|
343
|
-
try:
|
|
344
|
-
transaction = self.service.create_transaction(
|
|
345
|
-
dataset_rid=dataset_rid,
|
|
346
|
-
branch=branch,
|
|
347
|
-
transaction_type=transaction_type,
|
|
348
|
-
)
|
|
349
|
-
return {
|
|
350
|
-
"transaction_rid": getattr(transaction, "rid", None),
|
|
351
|
-
"dataset_rid": dataset_rid,
|
|
352
|
-
"branch": branch,
|
|
353
|
-
"transaction_type": transaction_type,
|
|
354
|
-
"status": getattr(transaction, "status", "OPEN"),
|
|
355
|
-
"created_time": getattr(transaction, "created_time", None),
|
|
356
|
-
"created_by": getattr(transaction, "created_by", None),
|
|
357
|
-
}
|
|
358
|
-
except Exception as e:
|
|
359
|
-
raise RuntimeError(
|
|
360
|
-
f"Failed to create transaction for dataset {dataset_rid}: {e}"
|
|
361
|
-
)
|
|
362
341
|
except Exception as e:
|
|
363
342
|
raise RuntimeError(
|
|
364
343
|
f"Failed to create transaction for dataset {dataset_rid}: {e}"
|
|
@@ -378,8 +357,8 @@ class DatasetService(BaseService):
|
|
|
378
357
|
Transaction commit result
|
|
379
358
|
"""
|
|
380
359
|
try:
|
|
381
|
-
#
|
|
382
|
-
self.service.Dataset.
|
|
360
|
+
# Use the v2 API Dataset.Transaction.commit method
|
|
361
|
+
self.service.Dataset.Transaction.commit(
|
|
383
362
|
dataset_rid=dataset_rid, transaction_rid=transaction_rid
|
|
384
363
|
)
|
|
385
364
|
|
|
@@ -390,23 +369,6 @@ class DatasetService(BaseService):
|
|
|
390
369
|
"committed_time": None, # Would need to get this from a status call
|
|
391
370
|
"success": True,
|
|
392
371
|
}
|
|
393
|
-
except AttributeError:
|
|
394
|
-
# Fallback to service.commit_transaction
|
|
395
|
-
try:
|
|
396
|
-
self.service.commit_transaction(
|
|
397
|
-
dataset_rid=dataset_rid, transaction_rid=transaction_rid
|
|
398
|
-
)
|
|
399
|
-
return {
|
|
400
|
-
"transaction_rid": transaction_rid,
|
|
401
|
-
"dataset_rid": dataset_rid,
|
|
402
|
-
"status": "COMMITTED",
|
|
403
|
-
"committed_time": None,
|
|
404
|
-
"success": True,
|
|
405
|
-
}
|
|
406
|
-
except Exception as e:
|
|
407
|
-
raise RuntimeError(
|
|
408
|
-
f"Failed to commit transaction {transaction_rid}: {e}"
|
|
409
|
-
)
|
|
410
372
|
except Exception as e:
|
|
411
373
|
raise RuntimeError(f"Failed to commit transaction {transaction_rid}: {e}")
|
|
412
374
|
|
|
@@ -424,8 +386,8 @@ class DatasetService(BaseService):
|
|
|
424
386
|
Transaction abort result
|
|
425
387
|
"""
|
|
426
388
|
try:
|
|
427
|
-
#
|
|
428
|
-
self.service.Dataset.
|
|
389
|
+
# Use the v2 API Dataset.Transaction.abort method
|
|
390
|
+
self.service.Dataset.Transaction.abort(
|
|
429
391
|
dataset_rid=dataset_rid, transaction_rid=transaction_rid
|
|
430
392
|
)
|
|
431
393
|
|
|
@@ -436,23 +398,6 @@ class DatasetService(BaseService):
|
|
|
436
398
|
"aborted_time": None, # Would need to get this from a status call
|
|
437
399
|
"success": True,
|
|
438
400
|
}
|
|
439
|
-
except AttributeError:
|
|
440
|
-
# Fallback to service.abort_transaction
|
|
441
|
-
try:
|
|
442
|
-
self.service.abort_transaction(
|
|
443
|
-
dataset_rid=dataset_rid, transaction_rid=transaction_rid
|
|
444
|
-
)
|
|
445
|
-
return {
|
|
446
|
-
"transaction_rid": transaction_rid,
|
|
447
|
-
"dataset_rid": dataset_rid,
|
|
448
|
-
"status": "ABORTED",
|
|
449
|
-
"aborted_time": None,
|
|
450
|
-
"success": True,
|
|
451
|
-
}
|
|
452
|
-
except Exception as e:
|
|
453
|
-
raise RuntimeError(
|
|
454
|
-
f"Failed to abort transaction {transaction_rid}: {e}"
|
|
455
|
-
)
|
|
456
401
|
except Exception as e:
|
|
457
402
|
raise RuntimeError(f"Failed to abort transaction {transaction_rid}: {e}")
|
|
458
403
|
|
|
@@ -470,8 +415,8 @@ class DatasetService(BaseService):
|
|
|
470
415
|
Transaction status information
|
|
471
416
|
"""
|
|
472
417
|
try:
|
|
473
|
-
#
|
|
474
|
-
transaction = self.service.Dataset.
|
|
418
|
+
# Use the v2 API Dataset.Transaction.get method
|
|
419
|
+
transaction = self.service.Dataset.Transaction.get(
|
|
475
420
|
dataset_rid=dataset_rid, transaction_rid=transaction_rid
|
|
476
421
|
)
|
|
477
422
|
|
|
@@ -486,27 +431,6 @@ class DatasetService(BaseService):
|
|
|
486
431
|
"committed_time": getattr(transaction, "committed_time", None),
|
|
487
432
|
"aborted_time": getattr(transaction, "aborted_time", None),
|
|
488
433
|
}
|
|
489
|
-
except AttributeError:
|
|
490
|
-
# Fallback to service.get_transaction
|
|
491
|
-
try:
|
|
492
|
-
transaction = self.service.get_transaction(
|
|
493
|
-
dataset_rid=dataset_rid, transaction_rid=transaction_rid
|
|
494
|
-
)
|
|
495
|
-
return {
|
|
496
|
-
"transaction_rid": transaction_rid,
|
|
497
|
-
"dataset_rid": dataset_rid,
|
|
498
|
-
"status": getattr(transaction, "status", None),
|
|
499
|
-
"transaction_type": getattr(transaction, "transaction_type", None),
|
|
500
|
-
"branch": getattr(transaction, "branch", None),
|
|
501
|
-
"created_time": getattr(transaction, "created_time", None),
|
|
502
|
-
"created_by": getattr(transaction, "created_by", None),
|
|
503
|
-
"committed_time": getattr(transaction, "committed_time", None),
|
|
504
|
-
"aborted_time": getattr(transaction, "aborted_time", None),
|
|
505
|
-
}
|
|
506
|
-
except Exception as e:
|
|
507
|
-
raise RuntimeError(
|
|
508
|
-
f"Failed to get transaction status {transaction_rid}: {e}"
|
|
509
|
-
)
|
|
510
434
|
except Exception as e:
|
|
511
435
|
raise RuntimeError(
|
|
512
436
|
f"Failed to get transaction status {transaction_rid}: {e}"
|
|
@@ -526,9 +450,10 @@ class DatasetService(BaseService):
|
|
|
526
450
|
List of transaction information dictionaries
|
|
527
451
|
"""
|
|
528
452
|
try:
|
|
529
|
-
#
|
|
530
|
-
|
|
531
|
-
|
|
453
|
+
# Use the v2 API Dataset.Transaction for transaction listing
|
|
454
|
+
# Note: This method may not exist in all SDK versions
|
|
455
|
+
transactions = self.service.Dataset.Transaction.list(
|
|
456
|
+
dataset_rid=dataset_rid, branch_name=branch
|
|
532
457
|
)
|
|
533
458
|
|
|
534
459
|
return [
|
|
@@ -545,37 +470,11 @@ class DatasetService(BaseService):
|
|
|
545
470
|
for transaction in transactions
|
|
546
471
|
]
|
|
547
472
|
except AttributeError:
|
|
548
|
-
#
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
return [
|
|
555
|
-
{
|
|
556
|
-
"transaction_rid": getattr(transaction, "rid", None),
|
|
557
|
-
"created_time": getattr(transaction, "created_time", None),
|
|
558
|
-
"created_by": getattr(transaction, "created_by", None),
|
|
559
|
-
"status": getattr(transaction, "status", None),
|
|
560
|
-
"transaction_type": getattr(
|
|
561
|
-
transaction, "transaction_type", None
|
|
562
|
-
),
|
|
563
|
-
"branch": getattr(transaction, "branch", branch),
|
|
564
|
-
"committed_time": getattr(transaction, "committed_time", None),
|
|
565
|
-
"aborted_time": getattr(transaction, "aborted_time", None),
|
|
566
|
-
}
|
|
567
|
-
for transaction in transactions
|
|
568
|
-
]
|
|
569
|
-
except AttributeError:
|
|
570
|
-
# Method not available in this SDK version
|
|
571
|
-
raise NotImplementedError(
|
|
572
|
-
"Transaction listing is not supported by this SDK version. "
|
|
573
|
-
"This feature may require a newer version of foundry-platform-python."
|
|
574
|
-
)
|
|
575
|
-
except Exception as e:
|
|
576
|
-
raise RuntimeError(
|
|
577
|
-
f"Failed to get transactions for dataset {dataset_rid}: {e}"
|
|
578
|
-
)
|
|
473
|
+
# Method not available in this SDK version
|
|
474
|
+
raise NotImplementedError(
|
|
475
|
+
"Transaction listing is not supported by this SDK version. "
|
|
476
|
+
"This feature may require a newer version of foundry-platform-python."
|
|
477
|
+
)
|
|
579
478
|
except Exception as e:
|
|
580
479
|
raise RuntimeError(
|
|
581
480
|
f"Failed to get transactions for dataset {dataset_rid}: {e}"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pltr/__init__.py,sha256=
|
|
1
|
+
pltr/__init__.py,sha256=isJrmDBLRag7Zc2UK9ZovWGOv7ji1Oh-zJtJMNJFkXw,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,7 +33,7 @@ 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=R2G781FI-sXtjUyLd91bVnmLb4cYZI3G8U5ndR9NLA4,1593
|
|
35
35
|
pltr/services/connectivity.py,sha256=34kazXhue5gNi1_2s2R5Ma4VQe6jP25CO-ztiPhCeZw,10548
|
|
36
|
-
pltr/services/dataset.py,sha256=
|
|
36
|
+
pltr/services/dataset.py,sha256=OeKRkkTRT_3uALsvipVzaFIOYRatqXUxLbLkbyCiqLc,20478
|
|
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
|
|
@@ -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=MuIgi8dSqvhzik7H0YQOq1sYPnY_poZOYeTVvrIY2Jk,44235
|
|
50
50
|
pltr/utils/progress.py,sha256=BKYbiLO61uhQbibabU7pxvvbAWMRLRmqk4pZldBQK_g,9053
|
|
51
|
-
pltr_cli-0.5.
|
|
52
|
-
pltr_cli-0.5.
|
|
53
|
-
pltr_cli-0.5.
|
|
54
|
-
pltr_cli-0.5.
|
|
55
|
-
pltr_cli-0.5.
|
|
51
|
+
pltr_cli-0.5.2.dist-info/METADATA,sha256=vWl7v5qxGJIOJYHLsRjY4fHdCPk6sWav2BTn-xS0F1Y,17714
|
|
52
|
+
pltr_cli-0.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
53
|
+
pltr_cli-0.5.2.dist-info/entry_points.txt,sha256=8tvEcW04kA_oAE2Dwwu-Og9efjl4ESJvs4AzlP2KBdQ,38
|
|
54
|
+
pltr_cli-0.5.2.dist-info/licenses/LICENSE,sha256=6VUFd_ytnOBD2O1tmkKrA-smigi9QEhYr_tge4h4z8Y,1070
|
|
55
|
+
pltr_cli-0.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|