You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by yz...@apache.org on 2026/03/30 16:11:27 UTC

(polaris) branch main updated: Keep CLI doctype consistent and fix cli doc (#4077)

This is an automated email from the ASF dual-hosted git repository.

yzheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 1023d76cb8 Keep CLI doctype consistent and fix cli doc (#4077)
1023d76cb8 is described below

commit 1023d76cb8ba24c189707c91bfd40da5ba5abd7d
Author: Yong Zheng <yo...@gmail.com>
AuthorDate: Mon Mar 30 11:11:22 2026 -0500

    Keep CLI doctype consistent and fix cli doc (#4077)
    
    * Keep CLI doctype consistent and fix cli doc
    
    * Fix cli doc
---
 client/python/apache_polaris/cli/command/namespaces.py   |  3 ++-
 client/python/apache_polaris/cli/command/policies.py     |  9 ++++++++-
 client/python/apache_polaris/cli/command/privileges.py   |  6 +++---
 client/python/apache_polaris/cli/command/setup.py        | 10 ++++++++++
 site/content/in-dev/unreleased/command-line-interface.md |  8 ++++----
 5 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/client/python/apache_polaris/cli/command/namespaces.py b/client/python/apache_polaris/cli/command/namespaces.py
index f4f9fa9fd5..78220866a1 100644
--- a/client/python/apache_polaris/cli/command/namespaces.py
+++ b/client/python/apache_polaris/cli/command/namespaces.py
@@ -34,7 +34,8 @@ from apache_polaris.sdk.catalog.api.policy_api import PolicyAPI
 class NamespacesCommand(Command):
     """
     A Command implementation to represent `polaris namespaces`. The instance attributes correspond to parameters
-    that can be provided to various subcommands
+    that can be provided to various subcommands, except `namespaces_subcommand` which represents the subcommand
+    itself.
 
     Example commands:
         * ./polaris namespaces create --catalog my_schema my_namespace
diff --git a/client/python/apache_polaris/cli/command/policies.py b/client/python/apache_polaris/cli/command/policies.py
index 7187edb83b..783f605d16 100644
--- a/client/python/apache_polaris/cli/command/policies.py
+++ b/client/python/apache_polaris/cli/command/policies.py
@@ -40,7 +40,14 @@ from apache_polaris.sdk.management import PolarisDefaultApi
 @dataclass
 class PoliciesCommand(Command):
     """
-    A Command implementation to represent `polaris policies`.
+    A Command implementation to represent `polaris policies`. The instance attributes correspond to parameters
+    that can be provided to various subcommands, except `policies_subcommand` which represents the subcommand
+    itself.
+
+    Example commands:
+        * ./polaris policies create --catalog some_catalog --namespace some.schema --policy-file some_policy.json --policy-type system.data-compaction some_policy
+        * ./polaris policies list --catalog some_catalog --applicable
+        * ./polaris policies attach --catalog some_catalog --namespace some.schema --attachment-type table-like --attachment-path some.schema.t some_table_policy
     """
 
     policies_subcommand: str
diff --git a/client/python/apache_polaris/cli/command/privileges.py b/client/python/apache_polaris/cli/command/privileges.py
index 93ca4164de..8853a780da 100644
--- a/client/python/apache_polaris/cli/command/privileges.py
+++ b/client/python/apache_polaris/cli/command/privileges.py
@@ -42,9 +42,9 @@ from apache_polaris.sdk.management import (
 @dataclass
 class PrivilegesCommand(Command):
     """
-    A Command implementation to represent `polaris privileges`. Unlike other commands, `privileges` itself takes two
-    parameters -- catalog_name and catalog_role_name. The other instance attributes, besides `privileges_subcommand` and
-    `action`, represent parameters provided to either the `grant` or `revoke` action.
+    A Command implementation to represent `polaris privileges`. The instance attributes correspond to parameters
+    that can be provided to various subcommands, except `privileges_subcommand` which represents the subcommand
+    itself.
 
     Example commands:
         * ./polaris privileges table grant --catalog c --catalog-role cr --namespace n --table t PRIVILEGE_NAME
diff --git a/client/python/apache_polaris/cli/command/setup.py b/client/python/apache_polaris/cli/command/setup.py
index 55927a0242..620645da19 100644
--- a/client/python/apache_polaris/cli/command/setup.py
+++ b/client/python/apache_polaris/cli/command/setup.py
@@ -56,6 +56,16 @@ logger = logging.getLogger(__name__)
 
 @dataclass
 class SetupCommand(Command):
+    """
+    A Command implementation to represent `polaris setup`. The instance attributes correspond to parameters
+    that can be provided to various subcommands, except `setup_subcommand` which represents the subcommand
+    itself.
+
+    Example commands:
+        * ./polaris setup apply setup-config.yaml
+        * ./polaris setup export
+    """
+
     setup_subcommand: str
     setup_config: Optional[str] = None
     dry_run: bool = False
diff --git a/site/content/in-dev/unreleased/command-line-interface.md b/site/content/in-dev/unreleased/command-line-interface.md
index 8f42acac2e..2570c2fdda 100644
--- a/site/content/in-dev/unreleased/command-line-interface.md
+++ b/site/content/in-dev/unreleased/command-line-interface.md
@@ -123,7 +123,7 @@ polaris profiles --help
 polaris setup --help
 ```
 
-### catalogs
+### Catalogs
 
 The `catalogs` command is used to create, discover, and otherwise manage catalogs within Polaris.
 
@@ -1236,7 +1236,7 @@ polaris privileges \
   VIEW_FULL_METADATA
 ```
 
-### profiles
+### Profiles
 
 The `profiles` command is used to manage stored authentication profiles in Polaris. Profiles allow authentication credentials to be saved and reused, eliminating the need to pass credentials with every command.
 
@@ -1522,11 +1522,11 @@ polaris policies update --catalog some_catalog --namespace some.schema --policy-
 polaris policies update --catalog some_catalog --namespace some.schema --policy-file my_updated_policy.json --policy-description "Updated policy description" my_policy
 ```
 
-### repair
+### Repair
 
 The `repair` command is a bash script wrapper used to regenerate Python client code and update necessary dependencies, ensuring the Polaris client remains up-to-date and functional. **Please note that this command does not support any options and its usage information is not available via a `--help` flag.**
 
-### setup
+### Setup
 
 The `setup` command is used to automate the creation of various entities in Polaris, such as principals, roles, catalogs, namespaces, privileges, and policies, based on a configuration file. This simplifies the process of setting up a Polaris environment.