Skip to content

Commit ca71882

Browse files
Excavator: Upgrade API Version (#150)
1 parent c387a04 commit ca71882

File tree

15 files changed

+180
-37
lines changed

15 files changed

+180
-37
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,6 +2438,7 @@ Namespace | Name | Import |
24382438
**Filesystem** | MissingDisplayName | `from foundry.v2.filesystem.errors import MissingDisplayName` |
24392439
**Filesystem** | MissingVariableValue | `from foundry.v2.filesystem.errors import MissingVariableValue` |
24402440
**Filesystem** | NotAuthorizedToApplyOrganization | `from foundry.v2.filesystem.errors import NotAuthorizedToApplyOrganization` |
2441+
**Filesystem** | OrganizationCannotBeRemoved | `from foundry.v2.filesystem.errors import OrganizationCannotBeRemoved` |
24412442
**Filesystem** | OrganizationMarkingNotOnSpace | `from foundry.v2.filesystem.errors import OrganizationMarkingNotOnSpace` |
24422443
**Filesystem** | OrganizationMarkingNotSupported | `from foundry.v2.filesystem.errors import OrganizationMarkingNotSupported` |
24432444
**Filesystem** | OrganizationsNotFound | `from foundry.v2.filesystem.errors import OrganizationsNotFound` |
@@ -2498,6 +2499,7 @@ Namespace | Name | Import |
24982499
**Ontologies** | FunctionExecutionFailed | `from foundry.v2.ontologies.errors import FunctionExecutionFailed` |
24992500
**Ontologies** | FunctionExecutionTimedOut | `from foundry.v2.ontologies.errors import FunctionExecutionTimedOut` |
25002501
**Ontologies** | FunctionInvalidInput | `from foundry.v2.ontologies.errors import FunctionInvalidInput` |
2502+
**Ontologies** | HighScaleComputationNotEnabled | `from foundry.v2.ontologies.errors import HighScaleComputationNotEnabled` |
25012503
**Ontologies** | InterfaceTypeNotFound | `from foundry.v2.ontologies.errors import InterfaceTypeNotFound` |
25022504
**Ontologies** | InterfaceTypesNotFound | `from foundry.v2.ontologies.errors import InterfaceTypesNotFound` |
25032505
**Ontologies** | InvalidAggregationOrdering | `from foundry.v2.ontologies.errors import InvalidAggregationOrdering` |
@@ -2709,6 +2711,7 @@ Namespace | Name | Import |
27092711
**Ontologies** | FunctionExecutionFailed | `from foundry.v1.ontologies.errors import FunctionExecutionFailed` |
27102712
**Ontologies** | FunctionExecutionTimedOut | `from foundry.v1.ontologies.errors import FunctionExecutionTimedOut` |
27112713
**Ontologies** | FunctionInvalidInput | `from foundry.v1.ontologies.errors import FunctionInvalidInput` |
2714+
**Ontologies** | HighScaleComputationNotEnabled | `from foundry.v1.ontologies.errors import HighScaleComputationNotEnabled` |
27122715
**Ontologies** | InterfaceTypeNotFound | `from foundry.v1.ontologies.errors import InterfaceTypeNotFound` |
27132716
**Ontologies** | InterfaceTypesNotFound | `from foundry.v1.ontologies.errors import InterfaceTypesNotFound` |
27142717
**Ontologies** | InvalidAggregationOrdering | `from foundry.v1.ontologies.errors import InvalidAggregationOrdering` |

docs/v2/SqlQueries/Query.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ preview = None
3434

3535

3636
try:
37-
api_response = foundry_client.sql_queries.Query.cancel_query(
37+
api_response = foundry_client.sql_queries.Query.cancel(
3838
query_id,
3939
preview=preview,
4040
)
41-
print("The cancel_query response:\n")
41+
print("The cancel response:\n")
4242
pprint(api_response)
4343
except foundry.PalantirRPCException as e:
44-
print("HTTP error when calling Query.cancel_query: %s\n" % e)
44+
print("HTTP error when calling Query.cancel: %s\n" % e)
4545

4646
```
4747

@@ -92,15 +92,15 @@ preview = None
9292

9393

9494
try:
95-
api_response = foundry_client.sql_queries.Query.execute_query(
95+
api_response = foundry_client.sql_queries.Query.execute(
9696
query=query,
9797
fallback_branch_ids=fallback_branch_ids,
9898
preview=preview,
9999
)
100-
print("The execute_query response:\n")
100+
print("The execute response:\n")
101101
pprint(api_response)
102102
except foundry.PalantirRPCException as e:
103-
print("HTTP error when calling Query.execute_query: %s\n" % e)
103+
print("HTTP error when calling Query.execute: %s\n" % e)
104104

105105
```
106106

foundry/_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
# using the autorelease bot
1818
__version__ = "0.0.0"
1919

20-
__openapi_document_version__ = "1.1089.0"
20+
__openapi_document_version__ = "1.1090.0"

foundry/v1/ontologies/errors/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
FunctionExecutionTimedOut,
6767
) # NOQA
6868
from foundry.v1.ontologies.errors._function_invalid_input import FunctionInvalidInput
69+
from foundry.v1.ontologies.errors._high_scale_computation_not_enabled import (
70+
HighScaleComputationNotEnabled,
71+
) # NOQA
6972
from foundry.v1.ontologies.errors._interface_type_not_found import InterfaceTypeNotFound
7073
from foundry.v1.ontologies.errors._interface_types_not_found import InterfaceTypesNotFound # NOQA
7174
from foundry.v1.ontologies.errors._invalid_aggregation_ordering import (
@@ -225,6 +228,7 @@
225228
"InvalidDurationGroupByValue",
226229
"PropertiesNotFilterable",
227230
"ParametersNotFound",
231+
"HighScaleComputationNotEnabled",
228232
"AggregationNestedObjectSetSizeExceededLimit",
229233
"ApplyActionFailed",
230234
"PropertyTypesSearchNotSupported",
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2024 Palantir Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
from __future__ import annotations
17+
18+
from dataclasses import dataclass
19+
from typing import Literal
20+
21+
from typing_extensions import TypedDict
22+
23+
from foundry._errors import InternalServerError
24+
25+
26+
class HighScaleComputationNotEnabledParameters(TypedDict):
27+
"""High-scale compute was required for this Ontology query but is not enabled on this enrollment."""
28+
29+
__pydantic_config__ = {"extra": "allow"} # type: ignore
30+
31+
32+
@dataclass
33+
class HighScaleComputationNotEnabled(InternalServerError):
34+
name: Literal["HighScaleComputationNotEnabled"]
35+
parameters: HighScaleComputationNotEnabledParameters
36+
error_instance_id: str
37+
38+
39+
__all__ = ["HighScaleComputationNotEnabled"]

foundry/v2/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6010,11 +6010,11 @@ def sql_queries_query():
60106010
pass
60116011

60126012

6013-
@sql_queries_query.command("cancel_query")
6013+
@sql_queries_query.command("cancel")
60146014
@click.argument("query_id", type=str, required=True)
60156015
@click.option("--preview", type=bool, required=False, help="""preview""")
60166016
@click.pass_obj
6017-
def sql_queries_query_cancel_query(
6017+
def sql_queries_query_cancel(
60186018
client: foundry.v2.FoundryClient,
60196019
query_id: str,
60206020
preview: Optional[bool],
@@ -6023,14 +6023,14 @@ def sql_queries_query_cancel_query(
60236023
Cancels a query. If the query is no longer running this is effectively a no-op.
60246024
60256025
"""
6026-
result = client.sql_queries.Query.cancel_query(
6026+
result = client.sql_queries.Query.cancel(
60276027
query_id=query_id,
60286028
preview=preview,
60296029
)
60306030
click.echo(repr(result))
60316031

60326032

6033-
@sql_queries_query.command("execute_query")
6033+
@sql_queries_query.command("execute")
60346034
@click.option(
60356035
"--query",
60366036
type=str,
@@ -6052,7 +6052,7 @@ def sql_queries_query_cancel_query(
60526052
)
60536053
@click.option("--preview", type=bool, required=False, help="""preview""")
60546054
@click.pass_obj
6055-
def sql_queries_query_execute_query(
6055+
def sql_queries_query_execute(
60566056
client: foundry.v2.FoundryClient,
60576057
query: str,
60586058
fallback_branch_ids: Optional[str],
@@ -6062,7 +6062,7 @@ def sql_queries_query_execute_query(
60626062
Executes a new query. Only the user that invoked the query can operate on the query.
60636063
60646064
"""
6065-
result = client.sql_queries.Query.execute_query(
6065+
result = client.sql_queries.Query.execute(
60666066
query=query,
60676067
fallback_branch_ids=(
60686068
None if fallback_branch_ids is None else json.loads(fallback_branch_ids)

foundry/v2/filesystem/errors/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@
9191
from foundry.v2.filesystem.errors._not_authorized_to_apply_organization import (
9292
NotAuthorizedToApplyOrganization,
9393
) # NOQA
94+
from foundry.v2.filesystem.errors._organization_cannot_be_removed import (
95+
OrganizationCannotBeRemoved,
96+
) # NOQA
9497
from foundry.v2.filesystem.errors._organization_marking_not_on_space import (
9598
OrganizationMarkingNotOnSpace,
9699
) # NOQA
@@ -182,6 +185,7 @@
182185
"MissingDisplayName",
183186
"MissingVariableValue",
184187
"NotAuthorizedToApplyOrganization",
188+
"OrganizationCannotBeRemoved",
185189
"OrganizationMarkingNotOnSpace",
186190
"OrganizationMarkingNotSupported",
187191
"OrganizationsNotFound",

foundry/v2/filesystem/errors/_invalid_organization_hierarchy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626

2727

2828
class InvalidOrganizationHierarchyParameters(TypedDict):
29-
"""The project created from template would have either no organizations in a marked space, or an organization which is not on the space."""
29+
"""
30+
Organizations on a project must also exist on the parent space. This error is thrown if the configuration
31+
of a project's organizations (on creation or subsequently) results in the project being marked with either
32+
no organizations in a marked space, or with an organization that is not present on the parent space.
33+
"""
3034

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2024 Palantir Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
from __future__ import annotations
17+
18+
from dataclasses import dataclass
19+
from typing import List
20+
from typing import Literal
21+
22+
from typing_extensions import TypedDict
23+
24+
from foundry._errors import BadRequestError
25+
from foundry.v2.core.models._organization_rid import OrganizationRid
26+
27+
28+
class OrganizationCannotBeRemovedParameters(TypedDict):
29+
"""
30+
An organization cannot be removed from a project if it would result in a project with no organizations
31+
under a space marked with an organization.
32+
"""
33+
34+
__pydantic_config__ = {"extra": "allow"} # type: ignore
35+
36+
organizationRids: List[OrganizationRid]
37+
38+
39+
@dataclass
40+
class OrganizationCannotBeRemoved(BadRequestError):
41+
name: Literal["OrganizationCannotBeRemoved"]
42+
parameters: OrganizationCannotBeRemovedParameters
43+
error_instance_id: str
44+
45+
46+
__all__ = ["OrganizationCannotBeRemoved"]

foundry/v2/filesystem/project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def create_from_template(
279279
:raises CreateProjectNoOwnerLikeRoleGrant: The create project request would create a project with no principal being granted an owner-like role. As a result, there would be no user with administrative privileges over the project. A role is defined to be owner-like if it has the `compass:edit-project` operation. In the common case of the default role-set, this is just the `compass:manage` role.
280280
:raises DefaultRolesNotInSpaceRoleSet: The requested default roles are not in the role set of the space for the project template.
281281
:raises InvalidDescription: Either the user has not passed a value for a template with unset project description, or has passed a value for a template with fixed project description.
282-
:raises InvalidOrganizationHierarchy: The project created from template would have either no organizations in a marked space, or an organization which is not on the space.
282+
:raises InvalidOrganizationHierarchy: Organizations on a project must also exist on the parent space. This error is thrown if the configuration of a project's organizations (on creation or subsequently) results in the project being marked with either no organizations in a marked space, or with an organization that is not present on the parent space.
283283
:raises InvalidOrganizations: Either the user has not passed organizations for a template with suggested organizations, or has passed organization for a template with fixed organizations.
284284
:raises InvalidPrincipalIdsForGroupTemplate: The template requested for project creation contains principal IDs that do not exist.
285285
:raises InvalidVariable: A variable referenced in the request to create project from template is not defined on the template.
@@ -777,7 +777,7 @@ def create_from_template(
777777
:raises CreateProjectNoOwnerLikeRoleGrant: The create project request would create a project with no principal being granted an owner-like role. As a result, there would be no user with administrative privileges over the project. A role is defined to be owner-like if it has the `compass:edit-project` operation. In the common case of the default role-set, this is just the `compass:manage` role.
778778
:raises DefaultRolesNotInSpaceRoleSet: The requested default roles are not in the role set of the space for the project template.
779779
:raises InvalidDescription: Either the user has not passed a value for a template with unset project description, or has passed a value for a template with fixed project description.
780-
:raises InvalidOrganizationHierarchy: The project created from template would have either no organizations in a marked space, or an organization which is not on the space.
780+
:raises InvalidOrganizationHierarchy: Organizations on a project must also exist on the parent space. This error is thrown if the configuration of a project's organizations (on creation or subsequently) results in the project being marked with either no organizations in a marked space, or with an organization that is not present on the parent space.
781781
:raises InvalidOrganizations: Either the user has not passed organizations for a template with suggested organizations, or has passed organization for a template with fixed organizations.
782782
:raises InvalidPrincipalIdsForGroupTemplate: The template requested for project creation contains principal IDs that do not exist.
783783
:raises InvalidVariable: A variable referenced in the request to create project from template is not defined on the template.
@@ -1275,7 +1275,7 @@ def create_from_template(
12751275
:raises CreateProjectNoOwnerLikeRoleGrant: The create project request would create a project with no principal being granted an owner-like role. As a result, there would be no user with administrative privileges over the project. A role is defined to be owner-like if it has the `compass:edit-project` operation. In the common case of the default role-set, this is just the `compass:manage` role.
12761276
:raises DefaultRolesNotInSpaceRoleSet: The requested default roles are not in the role set of the space for the project template.
12771277
:raises InvalidDescription: Either the user has not passed a value for a template with unset project description, or has passed a value for a template with fixed project description.
1278-
:raises InvalidOrganizationHierarchy: The project created from template would have either no organizations in a marked space, or an organization which is not on the space.
1278+
:raises InvalidOrganizationHierarchy: Organizations on a project must also exist on the parent space. This error is thrown if the configuration of a project's organizations (on creation or subsequently) results in the project being marked with either no organizations in a marked space, or with an organization that is not present on the parent space.
12791279
:raises InvalidOrganizations: Either the user has not passed organizations for a template with suggested organizations, or has passed organization for a template with fixed organizations.
12801280
:raises InvalidPrincipalIdsForGroupTemplate: The template requested for project creation contains principal IDs that do not exist.
12811281
:raises InvalidVariable: A variable referenced in the request to create project from template is not defined on the template.

0 commit comments

Comments
 (0)