Skip to content
Open
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.1590.0",
"minVersion": "1.1598.0",
"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: 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.1590.0"
__openapi_document_version__ = "1.1598.0"
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
13 changes: 11 additions & 2 deletions foundry_sdk/v2/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12779,11 +12779,19 @@ def sql_queries_sql_query_op_cancel(
`master` for most enrollments.
""",
)
@click.option(
"--serialization_format",
type=click.Choice(["ARROW", "CSV"]),
required=False,
help="""The format used to serialize query results. If not specified, defaults to `ARROW`.
""",
)
@click.pass_obj
def sql_queries_sql_query_op_execute(
client: FoundryClient,
query: str,
fallback_branch_ids: typing.Optional[str],
serialization_format: typing.Optional[typing.Literal["ARROW", "CSV"]],
):
"""
Executes a new query. Only the user that invoked the query can operate on the query. The size of query
Expand All @@ -12796,6 +12804,7 @@ def sql_queries_sql_query_op_execute(
fallback_branch_ids=(
None if fallback_branch_ids is None else json.loads(fallback_branch_ids)
),
serialization_format=serialization_format,
)
click.echo(repr(result))

Expand Down Expand Up @@ -12865,8 +12874,8 @@ def sql_queries_sql_query_op_get_results(
sql_query_id: str,
):
"""
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
7 changes: 6 additions & 1 deletion foundry_sdk/v2/filesystem/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,12 @@ class Space(core.ModelBase):


TrashStatus = typing.Literal["DIRECTLY_TRASHED", "ANCESTOR_TRASHED", "NOT_TRASHED"]
"""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.
"""


UsageAccountRid = core.RID
Expand Down
2 changes: 2 additions & 0 deletions foundry_sdk/v2/language_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from foundry_sdk.v2.language_models.utils import get_anthropic_base_url
from foundry_sdk.v2.language_models.utils import get_async_http_client
from foundry_sdk.v2.language_models.utils import get_foundry_token
from foundry_sdk.v2.language_models.utils import get_google_base_url
from foundry_sdk.v2.language_models.utils import get_http_client
from foundry_sdk.v2.language_models.utils import get_openai_base_url

Expand All @@ -29,4 +30,5 @@
"get_anthropic_base_url",
"get_http_client",
"get_async_http_client",
"get_google_base_url",
]
Loading