pltr-cli 0.7.0__py3-none-any.whl → 0.8.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.
pltr/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.7.0"
1
+ __version__ = "0.8.0"
pltr/commands/dataset.py CHANGED
@@ -585,9 +585,30 @@ def upload_file(
585
585
 
586
586
  except (ProfileNotFoundError, MissingCredentialsError) as e:
587
587
  formatter.print_error(f"Authentication error: {e}")
588
+ raise typer.Exit(1)
589
+ except FileNotFoundError as e:
590
+ formatter.print_error(f"File error: {e}")
591
+ raise typer.Exit(1)
592
+ except RuntimeError as e:
593
+ # RuntimeError from our service layer contains detailed error info
594
+ error_msg = str(e)
595
+ formatter.print_error(f"Upload failed: {error_msg}")
596
+
597
+ # If it looks like our enhanced error message, extract the suggestion part
598
+ if ". Suggestions: " in error_msg:
599
+ main_error, suggestions = error_msg.split(". Suggestions: ", 1)
600
+ formatter.print_error(main_error)
601
+ formatter.print_info(f"💡 Suggestions: {suggestions}")
602
+
588
603
  raise typer.Exit(1)
589
604
  except Exception as e:
590
- formatter.print_error(f"Failed to upload file: {e}")
605
+ # Fallback for any other exceptions
606
+ formatter.print_error(
607
+ f"Unexpected error during file upload: {type(e).__name__}: {e}"
608
+ )
609
+ formatter.print_info(
610
+ "💡 Try running the command again or check your connection"
611
+ )
591
612
  raise typer.Exit(1)
592
613
 
593
614
 
pltr/services/dataset.py CHANGED
@@ -319,9 +319,93 @@ class DatasetService(BaseService):
319
319
  "transaction_rid": getattr(result, "transaction_rid", transaction_rid),
320
320
  }
321
321
  except Exception as e:
322
- raise RuntimeError(
323
- f"Failed to upload file {file_path} to dataset {dataset_rid}: {e}"
324
- )
322
+ # Try to extract more detailed error information
323
+ error_msg = str(e).strip()
324
+ error_type = type(e).__name__
325
+
326
+ # Check for common HTTP/API errors
327
+ if hasattr(e, "response") and hasattr(e.response, "status_code"):
328
+ status_code = e.response.status_code
329
+ if hasattr(e.response, "text"):
330
+ response_text = e.response.text[:500] # Limit to 500 chars
331
+ error_details = f"HTTP {status_code}: {response_text}"
332
+ else:
333
+ error_details = f"HTTP {status_code}"
334
+ error_msg = f"{error_details} ({error_type}: {error_msg})"
335
+ elif hasattr(e, "status_code"):
336
+ error_msg = f"HTTP {e.status_code}: {error_msg}"
337
+ elif hasattr(e, "message"):
338
+ error_msg = f"{error_type}: {e.message}"
339
+ else:
340
+ if error_msg:
341
+ error_msg = f"{error_type}: {error_msg}"
342
+ else:
343
+ error_msg = f"{error_type} (no additional details available)"
344
+
345
+ # Add context about what might have gone wrong
346
+ context_hints = []
347
+ error_lower = error_msg.lower()
348
+
349
+ if (
350
+ "permission" in error_lower
351
+ or "forbidden" in error_lower
352
+ or "401" in error_msg
353
+ or "403" in error_msg
354
+ ):
355
+ context_hints.append(
356
+ "Check your authentication credentials and dataset permissions"
357
+ )
358
+ if "not found" in error_lower or "404" in error_msg:
359
+ context_hints.append(
360
+ "Verify the dataset RID and transaction RID are correct"
361
+ )
362
+ if "transaction" in error_lower:
363
+ context_hints.append(
364
+ "Check if the transaction is still open and not expired"
365
+ )
366
+ if "schema" in error_lower or "validation" in error_lower:
367
+ context_hints.append(
368
+ "The file might not match the expected dataset schema"
369
+ )
370
+ if (
371
+ "invalidparametercombination" in error_lower
372
+ or "invalid parameter" in error_lower
373
+ ):
374
+ context_hints.append(
375
+ "The combination of parameters (dataset RID, transaction RID, branch) may be invalid"
376
+ )
377
+ context_hints.append(
378
+ "Try without --transaction-rid, or verify the transaction belongs to this dataset"
379
+ )
380
+ if (
381
+ "opentransactionalreadyexists" in error_lower
382
+ or "transaction already exists" in error_lower
383
+ ):
384
+ context_hints.append(
385
+ "There's already an open transaction for this dataset"
386
+ )
387
+ context_hints.append(
388
+ "Use the existing transaction with --transaction-rid, or commit/abort it first"
389
+ )
390
+ context_hints.append(
391
+ "List transactions with: pltr dataset transactions list "
392
+ + dataset_rid
393
+ )
394
+
395
+ # Try to get more detailed error information from the exception
396
+ if hasattr(e, "__dict__"):
397
+ for attr in ["detail", "details", "error_message", "description"]:
398
+ if hasattr(e, attr):
399
+ detail = getattr(e, attr)
400
+ if detail and str(detail).strip():
401
+ error_msg += f" - {detail}"
402
+ break
403
+
404
+ full_error = f"Failed to upload file {file_path.name} to dataset {dataset_rid}: {error_msg}"
405
+ if context_hints:
406
+ full_error += f". Suggestions: {'; '.join(context_hints)}"
407
+
408
+ raise RuntimeError(full_error)
325
409
 
326
410
  def download_file(
327
411
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pltr-cli
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: Command-line interface for Palantir Foundry APIs
5
5
  Project-URL: Homepage, https://github.com/anjor/pltr-cli
6
6
  Project-URL: Repository, https://github.com/anjor/pltr-cli
@@ -1,4 +1,4 @@
1
- pltr/__init__.py,sha256=RaANGbRu5e-vehwXI1-Qe2ggPPfs1TQaZj072JdbLk4,22
1
+ pltr/__init__.py,sha256=iPlYCcIzuzW7T2HKDkmYlMkRI51dBLfNRxPPiWrfw9U,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
@@ -13,7 +13,7 @@ pltr/commands/alias.py,sha256=r9xMsQNrGvaixSlspzoO2IXQ44LFXuZM4itt8vC0dRc,6862
13
13
  pltr/commands/completion.py,sha256=YTxaRL4-rDs5n7aXf3ogFsxbHVJUBo_HiBbd0fbBPZ0,10870
14
14
  pltr/commands/configure.py,sha256=oYj-VlOEj3MDwtB2RC4bYOYzI_sXTanPnz7y1GmMTqY,4800
15
15
  pltr/commands/connectivity.py,sha256=m8_BYwHij_5IbrYFTU_SYYtbqLCjxA8VIQpbdlWJqHs,14758
16
- pltr/commands/dataset.py,sha256=NqGGF5IGhLGuy6FZxG-hd0p6yWlrVblzNwVqNjv3z20,50536
16
+ pltr/commands/dataset.py,sha256=nWmIZGpI_KtxY6_c5wbv1gcZOX4__KQg65iDkdObrpg,51403
17
17
  pltr/commands/folder.py,sha256=IAPPA3Smk1IWqThneEtZ08Zp79vDKVUabSkL_nDvUWk,10679
18
18
  pltr/commands/mediasets.py,sha256=FXq7OtYU9wLgUxQFcS_fkA4i_CozGnsYKxh8GOSI0ok,15342
19
19
  pltr/commands/ontology.py,sha256=zUgSrmv8xi26SQK7GsM3qusgR9Wuka0GyzE7L8DkduE,18317
@@ -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=23EBeJrFZkUBOU8EJcf5uMZyu-10rmIwMVGDZ4RZ2lI,38827
36
+ pltr/services/dataset.py,sha256=GIf73RX6ajdu03-wUWs6SsUYekhRQg-xlfEkcCxMam4,42622
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=38g3G2T5WUFKCCKo42NIBR8_Rdl4pp0ytCEZURoV3l4,50275
50
50
  pltr/utils/progress.py,sha256=BKYbiLO61uhQbibabU7pxvvbAWMRLRmqk4pZldBQK_g,9053
51
- pltr_cli-0.7.0.dist-info/METADATA,sha256=yuvIf5pOqN1pl_I_s6czGO8IeXVfEgZuyLGFsKjC8mw,17714
52
- pltr_cli-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
53
- pltr_cli-0.7.0.dist-info/entry_points.txt,sha256=8tvEcW04kA_oAE2Dwwu-Og9efjl4ESJvs4AzlP2KBdQ,38
54
- pltr_cli-0.7.0.dist-info/licenses/LICENSE,sha256=6VUFd_ytnOBD2O1tmkKrA-smigi9QEhYr_tge4h4z8Y,1070
55
- pltr_cli-0.7.0.dist-info/RECORD,,
51
+ pltr_cli-0.8.0.dist-info/METADATA,sha256=0Z1AZ5LdQgKblhyOy0JaKeoI6QfFcH23hanrwuBXX9U,17714
52
+ pltr_cli-0.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
53
+ pltr_cli-0.8.0.dist-info/entry_points.txt,sha256=8tvEcW04kA_oAE2Dwwu-Og9efjl4ESJvs4AzlP2KBdQ,38
54
+ pltr_cli-0.8.0.dist-info/licenses/LICENSE,sha256=6VUFd_ytnOBD2O1tmkKrA-smigi9QEhYr_tge4h4z8Y,1070
55
+ pltr_cli-0.8.0.dist-info/RECORD,,