Skip to content

Commit

Permalink
hide_command -> hide
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Jun 10, 2022
1 parent cf5934a commit 2454d81
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 73 deletions.
12 changes: 6 additions & 6 deletions databricks_cli/unity_catalog/catalog_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from databricks_cli.click_types import JsonClickType
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, json_cli_base


Expand Down Expand Up @@ -158,11 +158,11 @@ def catalogs_group(): # pragma: no cover

def register_catalog_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_catalog_cli), name='create-catalog')
cmd_group.add_command(hide_command(list_catalogs_cli), name='list-catalogs')
cmd_group.add_command(hide_command(get_catalog_cli), name='get-catalog')
cmd_group.add_command(hide_command(update_catalog_cli), name='update-catalog')
cmd_group.add_command(hide_command(delete_catalog_cli), name='delete-catalog')
cmd_group.add_command(hide(create_catalog_cli), name='create-catalog')
cmd_group.add_command(hide(list_catalogs_cli), name='list-catalogs')
cmd_group.add_command(hide(get_catalog_cli), name='get-catalog')
cmd_group.add_command(hide(update_catalog_cli), name='update-catalog')
cmd_group.add_command(hide(delete_catalog_cli), name='delete-catalog')

# Register command group.
catalogs_group.add_command(create_catalog_cli, name='create')
Expand Down
20 changes: 10 additions & 10 deletions databricks_cli/unity_catalog/cred_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from databricks_cli.click_types import DacIdClickType, JsonClickType, MetastoreIdClickType
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, json_cli_base


Expand Down Expand Up @@ -257,17 +257,17 @@ def storage_credentials_group(): # pragma: no cover

def register_cred_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_credential_cli), name='create-storage-credential')
cmd_group.add_command(hide_command(list_credentials_cli), name='list-storage-credentials')
cmd_group.add_command(hide_command(get_credential_cli), name='get-storage-credential')
cmd_group.add_command(hide_command(update_credential_cli), name='update-storage-credential')
cmd_group.add_command(hide_command(delete_credential_cli), name='delete-storage-credential')
cmd_group.add_command(hide(create_credential_cli), name='create-storage-credential')
cmd_group.add_command(hide(list_credentials_cli), name='list-storage-credentials')
cmd_group.add_command(hide(get_credential_cli), name='get-storage-credential')
cmd_group.add_command(hide(update_credential_cli), name='update-storage-credential')
cmd_group.add_command(hide(delete_credential_cli), name='delete-storage-credential')

# DAC cmds: [TO BE DEPRECATED ONCE STORAGE CREDENTIALS ARE FULLY SUPPORTED]
cmd_group.add_command(hide_command(create_dac_cli), name='create-dac')
cmd_group.add_command(hide_command(list_dacs_cli), name='list-dacs')
cmd_group.add_command(hide_command(get_dac_cli), name='get-dac')
cmd_group.add_command(hide_command(delete_dac_cli), name='delete-dac')
cmd_group.add_command(hide(create_dac_cli), name='create-dac')
cmd_group.add_command(hide(list_dacs_cli), name='list-dacs')
cmd_group.add_command(hide(get_dac_cli), name='get-dac')
cmd_group.add_command(hide(delete_dac_cli), name='delete-dac')

# Register command group.
storage_credentials_group.add_command(create_credential_cli, name='create')
Expand Down
42 changes: 21 additions & 21 deletions databricks_cli/unity_catalog/delta_sharing_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from databricks_cli.click_types import JsonClickType
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, json_cli_base


Expand Down Expand Up @@ -508,13 +508,13 @@ def shares_group(): # pragma: no cover

def register_shares_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_share_cli), name='create-share')
cmd_group.add_command(hide_command(list_shares_cli), name='list-shares')
cmd_group.add_command(hide_command(get_share_cli), name='get-share')
cmd_group.add_command(hide_command(update_share_cli), name='update-share')
cmd_group.add_command(hide_command(delete_share_cli), name='delete-share')
cmd_group.add_command(hide_command(list_share_permissions_cli), name='list-share-permissions')
cmd_group.add_command(hide_command(update_share_permissions_cli), name='update-share-permissions')
cmd_group.add_command(hide(create_share_cli), name='create-share')
cmd_group.add_command(hide(list_shares_cli), name='list-shares')
cmd_group.add_command(hide(get_share_cli), name='get-share')
cmd_group.add_command(hide(update_share_cli), name='update-share')
cmd_group.add_command(hide(delete_share_cli), name='delete-share')
cmd_group.add_command(hide(list_share_permissions_cli), name='list-share-permissions')
cmd_group.add_command(hide(update_share_permissions_cli), name='update-share-permissions')

# Register command group.
shares_group.add_command(create_share_cli, name='create')
Expand All @@ -534,13 +534,13 @@ def recipients_group(): # pragma: no cover

def register_recipients_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_recipient_cli), name='create-recipient')
cmd_group.add_command(hide_command(list_recipients_cli), name='list-recipients')
cmd_group.add_command(hide_command(get_recipient_cli), name='get-recipient')
cmd_group.add_command(hide_command(update_recipient_cli), name='update-recipient')
cmd_group.add_command(hide_command(rotate_recipient_token_cli), name='rotate-recipient-token')
cmd_group.add_command(hide_command(list_recipient_permissions_cli), name='list-recipient-permissions')
cmd_group.add_command(hide_command(delete_recipient_cli), name='delete-recipient')
cmd_group.add_command(hide(create_recipient_cli), name='create-recipient')
cmd_group.add_command(hide(list_recipients_cli), name='list-recipients')
cmd_group.add_command(hide(get_recipient_cli), name='get-recipient')
cmd_group.add_command(hide(update_recipient_cli), name='update-recipient')
cmd_group.add_command(hide(rotate_recipient_token_cli), name='rotate-recipient-token')
cmd_group.add_command(hide(list_recipient_permissions_cli), name='list-recipient-permissions')
cmd_group.add_command(hide(delete_recipient_cli), name='delete-recipient')

# Register command group.
recipients_group.add_command(create_recipient_cli, name='create')
Expand All @@ -560,12 +560,12 @@ def providers_group(): # pragma: no cover

def register_providers_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_provider_cli), name='create-provider')
cmd_group.add_command(hide_command(list_providers_cli), name='list-providers')
cmd_group.add_command(hide_command(get_provider_cli), name='get-provider')
cmd_group.add_command(hide_command(update_provider_cli), name='update-provider')
cmd_group.add_command(hide_command(delete_provider_cli), name='delete-provider')
cmd_group.add_command(hide_command(list_provider_shares_cli), name='list-provider-shares')
cmd_group.add_command(hide(create_provider_cli), name='create-provider')
cmd_group.add_command(hide(list_providers_cli), name='list-providers')
cmd_group.add_command(hide(get_provider_cli), name='get-provider')
cmd_group.add_command(hide(update_provider_cli), name='update-provider')
cmd_group.add_command(hide(delete_provider_cli), name='delete-provider')
cmd_group.add_command(hide(list_provider_shares_cli), name='list-provider-shares')

# Register command group.
providers_group.add_command(create_provider_cli, name='create')
Expand Down
14 changes: 7 additions & 7 deletions databricks_cli/unity_catalog/ext_loc_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from databricks_cli.click_types import JsonClickType
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.unity_catalog.utils import del_none, mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import del_none, mc_pretty_format, hide
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, json_cli_base


Expand Down Expand Up @@ -233,12 +233,12 @@ def external_locations_group(): # pragma: no cover

def register_ext_loc_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_location_cli), name='create-external-location')
cmd_group.add_command(hide_command(list_locations_cli), name='list-external-locations')
cmd_group.add_command(hide_command(get_location_cli), name='get-external-location')
cmd_group.add_command(hide_command(update_location_cli), name='update-external-location')
cmd_group.add_command(hide_command(delete_location_cli), name='delete-external-location')
cmd_group.add_command(hide_command(validate_location_cli), name='validate-external-location')
cmd_group.add_command(hide(create_location_cli), name='create-external-location')
cmd_group.add_command(hide(list_locations_cli), name='list-external-locations')
cmd_group.add_command(hide(get_location_cli), name='get-external-location')
cmd_group.add_command(hide(update_location_cli), name='update-external-location')
cmd_group.add_command(hide(delete_location_cli), name='delete-external-location')
cmd_group.add_command(hide(validate_location_cli), name='validate-external-location')

# Register command group.
external_locations_group.add_command(create_location_cli, name='create')
Expand Down
6 changes: 3 additions & 3 deletions databricks_cli/unity_catalog/lineage_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, to_graph


Expand Down Expand Up @@ -128,8 +128,8 @@ def lineage_group(): # pragma: no cover

def register_lineage_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(list_table_lineages_cli), name='list-table-lineages')
cmd_group.add_command(hide_command(list_column_lineages_cli), name='list-column-lineages')
cmd_group.add_command(hide(list_table_lineages_cli), name='list-table-lineages')
cmd_group.add_command(hide(list_column_lineages_cli), name='list-column-lineages')

# Register command group.
# Note: we deviate from the "noun-verb" pattern here because it would be awkward to have to
Expand Down
18 changes: 9 additions & 9 deletions databricks_cli/unity_catalog/metastore_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from databricks_cli.click_types import MetastoreIdClickType, WorkspaceIdClickType, JsonClickType
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, json_cli_base

Expand Down Expand Up @@ -216,14 +216,14 @@ def metastores_group(): # pragma: no cover

def register_metastore_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_metastore_cli), name='create-metastore')
cmd_group.add_command(hide_command(list_metastores_cli), name='list-metastores')
cmd_group.add_command(hide_command(get_metastore_cli), name='get-metastore')
cmd_group.add_command(hide_command(update_metastore_cli), name='update-metastore')
cmd_group.add_command(hide_command(delete_metastore_cli), name='delete-metastore')
cmd_group.add_command(hide_command(metastore_summary_cli), name='metastore-summary')
cmd_group.add_command(hide_command(assign_metastore_cli), name='assign-metastore')
cmd_group.add_command(hide_command(unassign_metastore_cli), name='unassign-metastore')
cmd_group.add_command(hide(create_metastore_cli), name='create-metastore')
cmd_group.add_command(hide(list_metastores_cli), name='list-metastores')
cmd_group.add_command(hide(get_metastore_cli), name='get-metastore')
cmd_group.add_command(hide(update_metastore_cli), name='update-metastore')
cmd_group.add_command(hide(delete_metastore_cli), name='delete-metastore')
cmd_group.add_command(hide(metastore_summary_cli), name='metastore-summary')
cmd_group.add_command(hide(assign_metastore_cli), name='assign-metastore')
cmd_group.add_command(hide(unassign_metastore_cli), name='unassign-metastore')

# Register command group.
metastores_group.add_command(create_metastore_cli, name='create')
Expand Down
6 changes: 3 additions & 3 deletions databricks_cli/unity_catalog/perms_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from databricks_cli.click_types import JsonClickType, OneOfOption
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, json_cli_base


Expand Down Expand Up @@ -137,8 +137,8 @@ def permissions_group(): # pragma: no cover

def register_perms_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(get_permissions_cli), name='get-permissions')
cmd_group.add_command(hide_command(update_permissions_cli), name='update-permissions')
cmd_group.add_command(hide(get_permissions_cli), name='get-permissions')
cmd_group.add_command(hide(update_permissions_cli), name='update-permissions')

# Register command group.
permissions_group.add_command(get_permissions_cli, name='get')
Expand Down
12 changes: 6 additions & 6 deletions databricks_cli/unity_catalog/schema_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from databricks_cli.click_types import JsonClickType
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, json_cli_base


Expand Down Expand Up @@ -157,11 +157,11 @@ def schemas_group(): # pragma: no cover

def register_schema_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_schema_cli), name='create-schema')
cmd_group.add_command(hide_command(list_schemas_cli), name='list-schemas')
cmd_group.add_command(hide_command(get_schema_cli), name='get-schema')
cmd_group.add_command(hide_command(update_schema_cli), name='update-schema')
cmd_group.add_command(hide_command(delete_schema_cli), name='delete-schema')
cmd_group.add_command(hide(create_schema_cli), name='create-schema')
cmd_group.add_command(hide(list_schemas_cli), name='list-schemas')
cmd_group.add_command(hide(get_schema_cli), name='get-schema')
cmd_group.add_command(hide(update_schema_cli), name='update-schema')
cmd_group.add_command(hide(delete_schema_cli), name='delete-schema')

# Register command group.
schemas_group.add_command(create_schema_cli, name='create')
Expand Down
14 changes: 7 additions & 7 deletions databricks_cli/unity_catalog/table_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from databricks_cli.click_types import JsonClickType
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.unity_catalog.api import UnityCatalogApi
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide_command
from databricks_cli.unity_catalog.utils import mc_pretty_format, hide
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS, json_cli_base


Expand Down Expand Up @@ -176,12 +176,12 @@ def tables_group(): # pragma: no cover

def register_table_commands(cmd_group):
# Register deprecated "verb-noun" commands for backward compatibility.
cmd_group.add_command(hide_command(create_table_cli), name='create-table')
cmd_group.add_command(hide_command(list_tables_cli), name='list-tables')
cmd_group.add_command(hide_command(list_table_summaries_cli), name='list-table-summaries')
cmd_group.add_command(hide_command(get_table_cli), name='get-table')
cmd_group.add_command(hide_command(update_table_cli), name='update-table')
cmd_group.add_command(hide_command(delete_table_cli), name='delete-table')
cmd_group.add_command(hide(create_table_cli), name='create-table')
cmd_group.add_command(hide(list_tables_cli), name='list-tables')
cmd_group.add_command(hide(list_table_summaries_cli), name='list-table-summaries')
cmd_group.add_command(hide(get_table_cli), name='get-table')
cmd_group.add_command(hide(update_table_cli), name='update-table')
cmd_group.add_command(hide(delete_table_cli), name='delete-table')

# Register command group.
tables_group.add_command(create_table_cli, name='create')
Expand Down
2 changes: 1 addition & 1 deletion databricks_cli/unity_catalog/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def del_none(json):
del_none(json[key])


def hide_command(cmd):
def hide(cmd):
"""
Return a copy of specified Click command instance with `hidden = True`.
This requires Click >= v7.0.
Expand Down

0 comments on commit 2454d81

Please sign in to comment.