Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2960,6 +2960,7 @@ Namespace | Name | Import |
**SqlQueries** | [ParameterValue](docs/v2/SqlQueries/models/ParameterValue.md) | `from foundry_sdk.v2.sql_queries.models import ParameterValue` |
**SqlQueries** | [QueryStatus](docs/v2/SqlQueries/models/QueryStatus.md) | `from foundry_sdk.v2.sql_queries.models import QueryStatus` |
**SqlQueries** | [RunningQueryStatus](docs/v2/SqlQueries/models/RunningQueryStatus.md) | `from foundry_sdk.v2.sql_queries.models import RunningQueryStatus` |
**SqlQueries** | [SerializationFormat](docs/v2/SqlQueries/models/SerializationFormat.md) | `from foundry_sdk.v2.sql_queries.models import SerializationFormat` |
**SqlQueries** | [SqlQueryId](docs/v2/SqlQueries/models/SqlQueryId.md) | `from foundry_sdk.v2.sql_queries.models import SqlQueryId` |
**SqlQueries** | [StructColumnFieldType](docs/v2/SqlQueries/models/StructColumnFieldType.md) | `from foundry_sdk.v2.sql_queries.models import StructColumnFieldType` |
**SqlQueries** | [StructColumnType](docs/v2/SqlQueries/models/StructColumnType.md) | `from foundry_sdk.v2.sql_queries.models import StructColumnType` |
Expand Down Expand Up @@ -3738,6 +3739,7 @@ Namespace | Name | Import |
**Models** | UnsupportedModelSource | `from foundry_sdk.v2.models.errors import UnsupportedModelSource` |
**Ontologies** | ActionContainsDuplicateEdits | `from foundry_sdk.v2.ontologies.errors import ActionContainsDuplicateEdits` |
**Ontologies** | ActionEditedPropertiesNotFound | `from foundry_sdk.v2.ontologies.errors import ActionEditedPropertiesNotFound` |
**Ontologies** | ActionEditsNotSupportedWithMarketplace | `from foundry_sdk.v2.ontologies.errors import ActionEditsNotSupportedWithMarketplace` |
**Ontologies** | ActionEditsReadOnlyEntity | `from foundry_sdk.v2.ontologies.errors import ActionEditsReadOnlyEntity` |
**Ontologies** | ActionNotFound | `from foundry_sdk.v2.ontologies.errors import ActionNotFound` |
**Ontologies** | ActionParameterInterfaceTypeNotFound | `from foundry_sdk.v2.ontologies.errors import ActionParameterInterfaceTypeNotFound` |
Expand All @@ -3754,6 +3756,7 @@ Namespace | Name | Import |
**Ontologies** | AttachmentNotFound | `from foundry_sdk.v2.ontologies.errors import AttachmentNotFound` |
**Ontologies** | AttachmentRidAlreadyExists | `from foundry_sdk.v2.ontologies.errors import AttachmentRidAlreadyExists` |
**Ontologies** | AttachmentSizeExceededLimit | `from foundry_sdk.v2.ontologies.errors import AttachmentSizeExceededLimit` |
**Ontologies** | BranchNotSupportedWithMarketplaceQuery | `from foundry_sdk.v2.ontologies.errors import BranchNotSupportedWithMarketplaceQuery` |
**Ontologies** | CipherChannelNotFound | `from foundry_sdk.v2.ontologies.errors import CipherChannelNotFound` |
**Ontologies** | CompositePrimaryKeyNotSupported | `from foundry_sdk.v2.ontologies.errors import CompositePrimaryKeyNotSupported` |
**Ontologies** | ConsistentSnapshotError | `from foundry_sdk.v2.ontologies.errors import ConsistentSnapshotError` |
Expand Down Expand Up @@ -3917,6 +3920,7 @@ Namespace | Name | Import |
**Orchestration** | TargetNotSupported | `from foundry_sdk.v2.orchestration.errors import TargetNotSupported` |
**Orchestration** | UnpauseSchedulePermissionDenied | `from foundry_sdk.v2.orchestration.errors import UnpauseSchedulePermissionDenied` |
**SqlQueries** | CancelSqlQueryPermissionDenied | `from foundry_sdk.v2.sql_queries.errors import CancelSqlQueryPermissionDenied` |
**SqlQueries** | ColumnTypesNotSupported | `from foundry_sdk.v2.sql_queries.errors import ColumnTypesNotSupported` |
**SqlQueries** | ExecuteOntologySqlQueryPermissionDenied | `from foundry_sdk.v2.sql_queries.errors import ExecuteOntologySqlQueryPermissionDenied` |
**SqlQueries** | ExecuteSqlQueryPermissionDenied | `from foundry_sdk.v2.sql_queries.errors import ExecuteSqlQueryPermissionDenied` |
**SqlQueries** | GetResultsSqlQueryPermissionDenied | `from foundry_sdk.v2.sql_queries.errors import GetResultsSqlQueryPermissionDenied` |
Expand Down Expand Up @@ -4057,6 +4061,7 @@ Namespace | Name | Import |
**Datasets** | UploadFilePermissionDenied | `from foundry_sdk.v1.datasets.errors import UploadFilePermissionDenied` |
**Ontologies** | ActionContainsDuplicateEdits | `from foundry_sdk.v1.ontologies.errors import ActionContainsDuplicateEdits` |
**Ontologies** | ActionEditedPropertiesNotFound | `from foundry_sdk.v1.ontologies.errors import ActionEditedPropertiesNotFound` |
**Ontologies** | ActionEditsNotSupportedWithMarketplace | `from foundry_sdk.v1.ontologies.errors import ActionEditsNotSupportedWithMarketplace` |
**Ontologies** | ActionEditsReadOnlyEntity | `from foundry_sdk.v1.ontologies.errors import ActionEditsReadOnlyEntity` |
**Ontologies** | ActionNotFound | `from foundry_sdk.v1.ontologies.errors import ActionNotFound` |
**Ontologies** | ActionParameterInterfaceTypeNotFound | `from foundry_sdk.v1.ontologies.errors import ActionParameterInterfaceTypeNotFound` |
Expand All @@ -4073,6 +4078,7 @@ Namespace | Name | Import |
**Ontologies** | AttachmentNotFound | `from foundry_sdk.v1.ontologies.errors import AttachmentNotFound` |
**Ontologies** | AttachmentRidAlreadyExists | `from foundry_sdk.v1.ontologies.errors import AttachmentRidAlreadyExists` |
**Ontologies** | AttachmentSizeExceededLimit | `from foundry_sdk.v1.ontologies.errors import AttachmentSizeExceededLimit` |
**Ontologies** | BranchNotSupportedWithMarketplaceQuery | `from foundry_sdk.v1.ontologies.errors import BranchNotSupportedWithMarketplaceQuery` |
**Ontologies** | CipherChannelNotFound | `from foundry_sdk.v1.ontologies.errors import CipherChannelNotFound` |
**Ontologies** | CompositePrimaryKeyNotSupported | `from foundry_sdk.v1.ontologies.errors import CompositePrimaryKeyNotSupported` |
**Ontologies** | ConsistentSnapshotError | `from foundry_sdk.v1.ontologies.errors import ConsistentSnapshotError` |
Expand Down
2 changes: 1 addition & 1 deletion docs-snippets-npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"sls": {
"dependencies": {
"com.palantir.foundry.api:api-gateway": {
"minVersion": "1.1593.0",
"minVersion": "1.1598.2",
"maxVersion": "1.x.x",
"optional": false
}
Expand Down
2 changes: 1 addition & 1 deletion docs-snippets-npm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,7 @@ export const PYTHON_PLATFORM_SNIPPETS: SdkSnippets<typeof PLATFORM_API_DOCS_SPEC
],
"v2.executeSqlQuery": [
{
"template": "from foundry_sdk import FoundryClient\nimport foundry_sdk\nfrom pprint import pprint\n\nclient = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname=\"example.palantirfoundry.com\")\n\n# str | The SQL query to execute. Queries should conform to the [Spark SQL dialect](https://spark.apache.org/docs/latest/sql-ref.html). This supports SELECT queries only. Datasets can be referenced in SQL queries by path or by RID. See the [documentation](https://www.palantir.com/docs/foundry/analytics-connectivity/odbc-jdbc-drivers/#use-sql-to-query-foundry-datasets) for more details.\nquery = \"SELECT * FROM `/Path/To/Dataset`\"\n# Optional[List[BranchName]] | The list of branch ids to use as fallbacks if the query fails to execute on the primary branch. If a is not explicitly provided in the SQL query, the resource will be queried on the first fallback branch provided that exists. If no fallback branches are provided the default branch is used. This is `master` for most enrollments.\nfallback_branch_ids = [\"master\"]\n\n\ntry:\n api_response = client.sql_queries.SqlQuery.execute(\n query=query, fallback_branch_ids=fallback_branch_ids\n )\n print(\"The execute response:\\n\")\n pprint(api_response)\nexcept foundry_sdk.PalantirRPCException as e:\n print(\"HTTP error when calling SqlQuery.execute: %s\\n\" % e)"
"template": "from foundry_sdk import FoundryClient\nimport foundry_sdk\nfrom pprint import pprint\n\nclient = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname=\"example.palantirfoundry.com\")\n\n# str | The SQL query to execute. Queries should conform to the [Spark SQL dialect](https://spark.apache.org/docs/latest/sql-ref.html). This supports SELECT queries only. Datasets can be referenced in SQL queries by path or by RID. See the [documentation](https://www.palantir.com/docs/foundry/analytics-connectivity/odbc-jdbc-drivers/#use-sql-to-query-foundry-datasets) for more details.\nquery = \"SELECT * FROM `/Path/To/Dataset`\"\n# Optional[List[BranchName]] | The list of branch ids to use as fallbacks if the query fails to execute on the primary branch. If a is not explicitly provided in the SQL query, the resource will be queried on the first fallback branch provided that exists. If no fallback branches are provided the default branch is used. This is `master` for most enrollments.\nfallback_branch_ids = [\"master\"]\n# Optional[SerializationFormat] | The format used to serialize query results. If not specified, defaults to `ARROW`.\nserialization_format = \"CSV\"\n\n\ntry:\n api_response = client.sql_queries.SqlQuery.execute(\n query=query,\n fallback_branch_ids=fallback_branch_ids,\n serialization_format=serialization_format,\n )\n print(\"The execute response:\\n\")\n pprint(api_response)\nexcept foundry_sdk.PalantirRPCException as e:\n print(\"HTTP error when calling SqlQuery.execute: %s\\n\" % e)"
}
],
"v2.executeOntologySqlQuery": [
Expand Down
6 changes: 5 additions & 1 deletion docs/v2/Filesystem/models/TrashStatus.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# TrashStatus

TrashStatus
Values:
- **DIRECTLY_TRASHED**: The resource was specifically trashed by a user. It can be restored directly.
- **ANCESTOR_TRASHED**: A folder that contains this resource was trashed by a user. Restoring this resource requires restoring the original folder.
- **NOT_TRASHED**: The default status of resources.


| **Value** |
| --------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/v2/Ontologies/CipherTextProperty.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Method | HTTP request | Release Stage |
------------- | ------------- | ----- |
[**decrypt**](#decrypt) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/ciphertexts/{property}/decrypt | Public Beta |
[**decrypt**](#decrypt) | **GET** /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/ciphertexts/{property}/decrypt | Stable |

# **decrypt**
Decrypt the value of a ciphertext property.
Expand Down
11 changes: 8 additions & 3 deletions docs/v2/SqlQueries/SqlQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Name | Type | Description | Notes |
------------- | ------------- | ------------- | ------------- |
**query** | str | The SQL query to execute. Queries should conform to the [Spark SQL dialect](https://spark.apache.org/docs/latest/sql-ref.html). This supports SELECT queries only. Datasets can be referenced in SQL queries by path or by RID. See the [documentation](https://www.palantir.com/docs/foundry/analytics-connectivity/odbc-jdbc-drivers/#use-sql-to-query-foundry-datasets) for more details. | |
**fallback_branch_ids** | Optional[List[BranchName]] | The list of branch ids to use as fallbacks if the query fails to execute on the primary branch. If a is not explicitly provided in the SQL query, the resource will be queried on the first fallback branch provided that exists. If no fallback branches are provided the default branch is used. This is `master` for most enrollments. | [optional] |
**serialization_format** | Optional[SerializationFormat] | The format used to serialize query results. If not specified, defaults to `ARROW`. | [optional] |

### Return type
**QueryStatus**
Expand All @@ -85,11 +86,15 @@ client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.pa
query = "SELECT * FROM `/Path/To/Dataset`"
# Optional[List[BranchName]] | The list of branch ids to use as fallbacks if the query fails to execute on the primary branch. If a is not explicitly provided in the SQL query, the resource will be queried on the first fallback branch provided that exists. If no fallback branches are provided the default branch is used. This is `master` for most enrollments.
fallback_branch_ids = ["master"]
# Optional[SerializationFormat] | The format used to serialize query results. If not specified, defaults to `ARROW`.
serialization_format = "CSV"


try:
api_response = client.sql_queries.SqlQuery.execute(
query=query, fallback_branch_ids=fallback_branch_ids
query=query,
fallback_branch_ids=fallback_branch_ids,
serialization_format=serialization_format,
)
print("The execute response:\n")
pprint(api_response)
Expand Down Expand Up @@ -175,8 +180,8 @@ See [README](../../../README.md#authorization)
[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v2-link) [[Back to Model list]](../../../README.md#models-v2-link) [[Back to README]](../../../README.md)

# **get_results**
Gets the results of a query. The results of the query are returned in the
[Apache Arrow](https://arrow.apache.org/) format.
Gets the results of a query. Results are returned in the `serializationFormat` specified at execute time
(defaulting to [Apache Arrow](https://arrow.apache.org/) if no format is provided).

This endpoint implements long polling and requests will time out after one minute. They can be safely
retried while the query is still running.
Expand Down
1 change: 1 addition & 0 deletions docs/v2/SqlQueries/models/ExecuteSqlQueryRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ExecuteSqlQueryRequest
| ------------ | ------------- | ------------- | ------------- |
**query** | str | Yes | The SQL query to execute. Queries should conform to the [Spark SQL dialect](https://spark.apache.org/docs/latest/sql-ref.html). This supports SELECT queries only. Datasets can be referenced in SQL queries by path or by RID. See the [documentation](https://www.palantir.com/docs/foundry/analytics-connectivity/odbc-jdbc-drivers/#use-sql-to-query-foundry-datasets) for more details. |
**fallback_branch_ids** | Optional[List[BranchName]] | No | The list of branch ids to use as fallbacks if the query fails to execute on the primary branch. If a is not explicitly provided in the SQL query, the resource will be queried on the first fallback branch provided that exists. If no fallback branches are provided the default branch is used. This is `master` for most enrollments. |
**serialization_format** | Optional[SerializationFormat] | No | The format used to serialize query results. If not specified, defaults to `ARROW`. |


[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
12 changes: 12 additions & 0 deletions docs/v2/SqlQueries/models/SerializationFormat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SerializationFormat

Format for SQL query result serialization.


| **Value** |
| --------- |
| `"ARROW"` |
| `"CSV"` |


[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
2 changes: 2 additions & 0 deletions foundry_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from foundry_sdk._core import UserTokenAuth

# Context and environment variables
from foundry_sdk._core.context_and_environment_vars import ADDITIONAL_USER_AGENTS
from foundry_sdk._core.context_and_environment_vars import ATTRIBUTION_VAR
from foundry_sdk._core.context_and_environment_vars import HOSTNAME_ENV_VAR
from foundry_sdk._core.context_and_environment_vars import HOSTNAME_VAR
Expand Down Expand Up @@ -86,6 +87,7 @@
"PublicClientAuth",
"UserTokenAuth",
"Config",
"ADDITIONAL_USER_AGENTS",
"ATTRIBUTION_VAR",
"HOSTNAME_VAR",
"HOSTNAME_ENV_VAR",
Expand Down
5 changes: 5 additions & 0 deletions foundry_sdk/_core/context_and_environment_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
ATTRIBUTION_VAR: ContextVar[Optional[list[str]]] = ContextVar("ATTRIBUTION_RESOURCES", default=None)
ATTRIBUTION_CONTEXT_VARS: list[ContextVar[Optional[list[str]]]] = [ATTRIBUTION_VAR]

# Additional user agent variables
ADDITIONAL_USER_AGENTS: ContextVar[Optional[list[str]]] = ContextVar(
Copy link
Copy Markdown
Contributor

@bryantpark04 bryantpark04 May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinBNaughton generator changes here

"ADDITIONAL_USER_AGENTS", default=None
)

# Trace and Span context variables
TRACE_ID_VAR: ContextVar[Optional[str]] = ContextVar("FOUNDRY_TRACE_ID", default=None)
SPAN_ID_VAR: ContextVar[Optional[str]] = ContextVar("FOUNDRY_SPAN_ID", default=None)
Expand Down
9 changes: 8 additions & 1 deletion foundry_sdk/_core/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import httpx

from foundry_sdk._core.config import Config
from foundry_sdk._core.context_and_environment_vars import ADDITIONAL_USER_AGENTS
from foundry_sdk._core.context_and_environment_vars import ATTRIBUTION_CONTEXT_VARS
from foundry_sdk._core.context_and_environment_vars import SAMPLED_CONTEXT_VARS
from foundry_sdk._core.context_and_environment_vars import SAMPLED_ENV_VARS
Expand Down Expand Up @@ -129,8 +130,14 @@ def _prepare_client_data(
# https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
attribution_header = ", ".join(attribution) if attribution is not None else None

user_agent = f"python-foundry-platform-sdk/{__version__} python/{sys.version_info.major}.{sys.version_info.minor}"

additional_user_agents = ADDITIONAL_USER_AGENTS.get()
if additional_user_agents:
user_agent += " " + " ".join(additional_user_agents)

headers = {
"User-Agent": f"python-foundry-platform-sdk/{__version__} python/{sys.version_info.major}.{sys.version_info.minor}",
"User-Agent": user_agent,
**(config.default_headers or {}),
}

Expand Down
2 changes: 1 addition & 1 deletion foundry_sdk/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# using the autorelease bot
__version__ = "0.0.0"

__openapi_document_version__ = "1.1593.0"
__openapi_document_version__ = "1.1598.2"
28 changes: 28 additions & 0 deletions foundry_sdk/v1/ontologies/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ class ActionEditedPropertiesNotFound(errors.BadRequestError):
error_instance_id: str


class ActionEditsNotSupportedWithMarketplaceParameters(typing_extensions.TypedDict):
"""Returning action edits is not supported when using marketplace bindings."""

__pydantic_config__ = {"extra": "allow"} # type: ignore


@dataclass
class ActionEditsNotSupportedWithMarketplace(errors.BadRequestError):
name: typing.Literal["ActionEditsNotSupportedWithMarketplace"]
parameters: ActionEditsNotSupportedWithMarketplaceParameters
error_instance_id: str


class ActionEditsReadOnlyEntityParameters(typing_extensions.TypedDict):
"""The given action request performs edits on a type that is read-only or does not allow edits."""

Expand Down Expand Up @@ -326,6 +339,19 @@ class AttachmentSizeExceededLimit(errors.BadRequestError):
error_instance_id: str


class BranchNotSupportedWithMarketplaceQueryParameters(typing_extensions.TypedDict):
"""The branch parameter is not supported when executing queries with marketplace bindings."""

__pydantic_config__ = {"extra": "allow"} # type: ignore


@dataclass
class BranchNotSupportedWithMarketplaceQuery(errors.BadRequestError):
name: typing.Literal["BranchNotSupportedWithMarketplaceQuery"]
parameters: BranchNotSupportedWithMarketplaceQueryParameters
error_instance_id: str


class CipherChannelNotFoundParameters(typing_extensions.TypedDict):
"""
The Cipher Channel was not found.
Expand Down Expand Up @@ -2448,6 +2474,7 @@ class ViewObjectPermissionDenied(errors.PermissionDeniedError):
__all__ = [
"ActionContainsDuplicateEdits",
"ActionEditedPropertiesNotFound",
"ActionEditsNotSupportedWithMarketplace",
"ActionEditsReadOnlyEntity",
"ActionNotFound",
"ActionParameterInterfaceTypeNotFound",
Expand All @@ -2464,6 +2491,7 @@ class ViewObjectPermissionDenied(errors.PermissionDeniedError):
"AttachmentNotFound",
"AttachmentRidAlreadyExists",
"AttachmentSizeExceededLimit",
"BranchNotSupportedWithMarketplaceQuery",
"CipherChannelNotFound",
"CompositePrimaryKeyNotSupported",
"ConsistentSnapshotError",
Expand Down
Loading