Skip to content

Commit 0d34b23

Browse files
committed
chore(enhancement): rename python package to apache-polaris
- reorganize python package catalogs - union all submodules (cli, polaris) under apache_polaris module - put polaris generated context into apache_polaris/sdk - make apache_polaris as a main module
1 parent 491a9e3 commit 0d34b23

33 files changed

+201
-142
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ client/python/poetry.lock
3030
/pyproject.toml
3131
client/python/.openapi-generator/
3232
client/python/docs/
33-
client/python/polaris/
33+
client/python/apache_polaris/sdk/
3434
client/python/test/
3535
!client/python/test/test_cli_parsing.py
3636

File renamed without changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
File renamed without changes.

client/python/cli/api_client_builder.py renamed to client/python/apache_polaris/cli/api_client_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from functools import cached_property
2323
from typing import Optional, Dict
2424

25-
from cli.constants import (
25+
from apache_polaris.cli.constants import (
2626
CONFIG_FILE,
2727
CLIENT_PROFILE_ENV,
2828
CLIENT_ID_ENV,
@@ -33,8 +33,8 @@
3333
DEFAULT_HOSTNAME,
3434
DEFAULT_PORT
3535
)
36-
from cli.options.option_tree import Argument
37-
from polaris.management import ApiClient, Configuration
36+
from apache_polaris.cli.options.option_tree import Argument
37+
from apache_polaris.sdk.management import ApiClient, Configuration
3838

3939

4040
def _load_profiles() -> Dict[str, str]:

client/python/cli/command/__init__.py renamed to client/python/apache_polaris/cli/command/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import argparse
2020
from abc import ABC
2121

22-
from cli.constants import Commands, Arguments
23-
from cli.options.parser import Parser
24-
from polaris.management import PolarisDefaultApi
22+
from apache_polaris.cli.constants import Commands, Arguments
23+
from apache_polaris.cli.options.parser import Parser
24+
from apache_polaris.sdk.management import PolarisDefaultApi
2525

2626

2727
class Command(ABC):
@@ -44,7 +44,7 @@ def options_get(key, f=lambda x: x):
4444

4545
command = None
4646
if options.command == Commands.CATALOGS:
47-
from cli.command.catalogs import CatalogsCommand
47+
from apache_polaris.cli.command.catalogs import CatalogsCommand
4848

4949
command = CatalogsCommand(
5050
options_get(f"{Commands.CATALOGS}_subcommand"),
@@ -87,7 +87,7 @@ def options_get(key, f=lambda x: x):
8787
catalog_signing_name=options_get(Arguments.CATALOG_SIGNING_NAME)
8888
)
8989
elif options.command == Commands.PRINCIPALS:
90-
from cli.command.principals import PrincipalsCommand
90+
from apache_polaris.cli.command.principals import PrincipalsCommand
9191

9292
command = PrincipalsCommand(
9393
options_get(f"{Commands.PRINCIPALS}_subcommand"),
@@ -104,7 +104,7 @@ def options_get(key, f=lambda x: x):
104104
new_client_secret=options_get(Arguments.NEW_CLIENT_SECRET),
105105
)
106106
elif options.command == Commands.PRINCIPAL_ROLES:
107-
from cli.command.principal_roles import PrincipalRolesCommand
107+
from apache_polaris.cli.command.principal_roles import PrincipalRolesCommand
108108

109109
command = PrincipalRolesCommand(
110110
options_get(f"{Commands.PRINCIPAL_ROLES}_subcommand"),
@@ -119,7 +119,7 @@ def options_get(key, f=lambda x: x):
119119
else remove_properties,
120120
)
121121
elif options.command == Commands.CATALOG_ROLES:
122-
from cli.command.catalog_roles import CatalogRolesCommand
122+
from apache_polaris.cli.command.catalog_roles import CatalogRolesCommand
123123

124124
command = CatalogRolesCommand(
125125
options_get(f"{Commands.CATALOG_ROLES}_subcommand"),
@@ -133,7 +133,7 @@ def options_get(key, f=lambda x: x):
133133
else remove_properties,
134134
)
135135
elif options.command == Commands.PRIVILEGES:
136-
from cli.command.privileges import PrivilegesCommand
136+
from apache_polaris.cli.command.privileges import PrivilegesCommand
137137

138138
subcommand = options_get(f"{Commands.PRIVILEGES}_subcommand")
139139
command = PrivilegesCommand(
@@ -150,7 +150,7 @@ def options_get(key, f=lambda x: x):
150150
cascade=options_get(Arguments.CASCADE),
151151
)
152152
elif options.command == Commands.NAMESPACES:
153-
from cli.command.namespaces import NamespacesCommand
153+
from apache_polaris.cli.command.namespaces import NamespacesCommand
154154

155155
subcommand = options_get(f"{Commands.NAMESPACES}_subcommand")
156156
command = NamespacesCommand(
@@ -164,14 +164,14 @@ def options_get(key, f=lambda x: x):
164164
properties=properties,
165165
)
166166
elif options.command == Commands.PROFILES:
167-
from cli.command.profiles import ProfilesCommand
167+
from apache_polaris.cli.command.profiles import ProfilesCommand
168168

169169
subcommand = options_get(f"{Commands.PROFILES}_subcommand")
170170
command = ProfilesCommand(
171171
subcommand, profile_name=options_get(Arguments.PROFILE)
172172
)
173173
elif options.command == Commands.POLICIES:
174-
from cli.command.policies import PoliciesCommand
174+
from apache_polaris.cli.command.policies import PoliciesCommand
175175

176176
subcommand = options_get(f"{Commands.POLICIES}_subcommand")
177177
command = PoliciesCommand(

client/python/cli/command/catalog_roles.py renamed to client/python/apache_polaris/cli/command/catalog_roles.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
from pydantic import StrictStr
2323

24-
from cli.command import Command
25-
from cli.constants import Subcommands, Arguments
26-
from cli.options.option_tree import Argument
27-
from polaris.management import (
24+
from apache_polaris.cli.command import Command
25+
from apache_polaris.cli.constants import Subcommands, Arguments
26+
from apache_polaris.cli.options.option_tree import Argument
27+
from apache_polaris.sdk.management import (
2828
PolarisDefaultApi,
2929
CreateCatalogRoleRequest,
3030
CatalogRole,

client/python/cli/command/catalogs.py renamed to client/python/apache_polaris/cli/command/catalogs.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,27 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
from dataclasses import dataclass
20-
from typing import Dict, List
2119

20+
from apache_polaris.cli.command import Command
21+
from apache_polaris.cli.constants import StorageType, CatalogType, \
22+
CatalogConnectionType, Subcommands, Arguments, AuthenticationType, \
23+
ServiceIdentityType
24+
from apache_polaris.cli.options.option_tree import Argument
25+
26+
from dataclasses import dataclass
2227
from pydantic import StrictStr, SecretStr
28+
from typing import Dict, List
2329

24-
from cli.command import Command
25-
from cli.constants import StorageType, CatalogType, CatalogConnectionType, Subcommands, Arguments, AuthenticationType, \
26-
ServiceIdentityType
27-
from cli.options.option_tree import Argument
28-
from polaris.management import PolarisDefaultApi, CreateCatalogRequest, UpdateCatalogRequest, \
29-
StorageConfigInfo, ExternalCatalog, AwsStorageConfigInfo, AzureStorageConfigInfo, GcpStorageConfigInfo, \
30-
PolarisCatalog, CatalogProperties, BearerAuthenticationParameters, ImplicitAuthenticationParameters, \
31-
OAuthClientCredentialsParameters, SigV4AuthenticationParameters, HadoopConnectionConfigInfo, \
32-
IcebergRestConnectionConfigInfo, AwsIamServiceIdentityInfo
30+
from apache_polaris.sdk.management import PolarisDefaultApi, \
31+
CreateCatalogRequest, \
32+
UpdateCatalogRequest, \
33+
StorageConfigInfo, ExternalCatalog, AwsStorageConfigInfo, \
34+
AzureStorageConfigInfo, GcpStorageConfigInfo, \
35+
PolarisCatalog, CatalogProperties, BearerAuthenticationParameters, \
36+
ImplicitAuthenticationParameters, \
37+
OAuthClientCredentialsParameters, SigV4AuthenticationParameters, \
38+
HadoopConnectionConfigInfo, \
39+
IcebergRestConnectionConfigInfo, AwsIamServiceIdentityInfo
3340

3441

3542
@dataclass

client/python/cli/command/namespaces.py renamed to client/python/apache_polaris/cli/command/namespaces.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@
1818
#
1919
import json
2020
from dataclasses import dataclass
21-
from typing import Dict, Optional, List
22-
2321
from pydantic import StrictStr
22+
from typing import Dict, Optional, List
2423

25-
from cli.command import Command
26-
from cli.command.utils import get_catalog_api_client
27-
from cli.constants import Subcommands, Arguments, UNIT_SEPARATOR
28-
from cli.options.option_tree import Argument
29-
from polaris.catalog import IcebergCatalogAPI, CreateNamespaceRequest
30-
from polaris.management import PolarisDefaultApi
24+
from apache_polaris.cli.command import Command
25+
from apache_polaris.cli.command.utils import get_catalog_api_client
26+
from apache_polaris.cli.constants import Subcommands, Arguments, UNIT_SEPARATOR
27+
from apache_polaris.cli.options.option_tree import Argument
28+
from apache_polaris.sdk.catalog import IcebergCatalogAPI, CreateNamespaceRequest
29+
from apache_polaris.sdk.management import PolarisDefaultApi
3130

3231

3332
@dataclass

client/python/cli/command/policies.py renamed to client/python/apache_polaris/cli/command/policies.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,29 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
import os
19+
2020
import json
21+
22+
import os
2123
from dataclasses import dataclass
2224
from typing import Optional, Dict
23-
from cli.command import Command
24-
from cli.command.utils import get_catalog_api_client
25-
from cli.constants import Subcommands, Arguments, UNIT_SEPARATOR
26-
from cli.options.option_tree import Argument
27-
from polaris.management import PolarisDefaultApi
28-
from polaris.catalog.api.policy_api import PolicyAPI
29-
from polaris.catalog.models.create_policy_request import CreatePolicyRequest
30-
from polaris.catalog.models.update_policy_request import UpdatePolicyRequest
31-
from polaris.catalog.models.policy_attachment_target import PolicyAttachmentTarget
32-
from polaris.catalog.models.attach_policy_request import AttachPolicyRequest
33-
from polaris.catalog.models.detach_policy_request import DetachPolicyRequest
3425

26+
from apache_polaris.cli.command import Command
27+
from apache_polaris.cli.command.utils import get_catalog_api_client
28+
from apache_polaris.cli.constants import Subcommands, Arguments, UNIT_SEPARATOR
29+
from apache_polaris.cli.options.option_tree import Argument
30+
from apache_polaris.sdk.catalog.api.policy_api import PolicyAPI
31+
from apache_polaris.sdk.catalog.models.attach_policy_request import \
32+
AttachPolicyRequest
33+
from apache_polaris.sdk.catalog.models.create_policy_request import \
34+
CreatePolicyRequest
35+
from apache_polaris.sdk.catalog.models.detach_policy_request import \
36+
DetachPolicyRequest
37+
from apache_polaris.sdk.catalog.models.policy_attachment_target import \
38+
PolicyAttachmentTarget
39+
from apache_polaris.sdk.catalog.models.update_policy_request import \
40+
UpdatePolicyRequest
41+
from apache_polaris.sdk.management import PolarisDefaultApi
3542

3643

3744
@dataclass

0 commit comments

Comments
 (0)