Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Oct 4, 2023
1 parent d4ed50f commit a811dcd
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 95 deletions.
11 changes: 7 additions & 4 deletions databricks_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@

import warnings

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)

def issue_deprecation_warning():
warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=3)

issue_deprecation_warning()

def initialize_cli_for_databricks_notebooks():
import IPython
Expand Down
7 changes: 2 additions & 5 deletions databricks_cli/cluster_policies/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/clusters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/configure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/dbfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/groups/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/instance_pools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/jobs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/libraries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
8 changes: 2 additions & 6 deletions databricks_cli/oauth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
from databricks_cli import issue_deprecation_warning

issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/pipelines/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/repos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/runs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
from .service import *
from .api_client import ApiClient

import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/secrets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/stack/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/tokens/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/unity_catalog/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()
7 changes: 2 additions & 5 deletions databricks_cli/workspace/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import warnings
from databricks_cli import issue_deprecation_warning

warnings.warn("the databricks-cli module is deprecated in favor of databricks-sdk-py. Python 3.12 will be the last "
"version of Python supported by databricks-cli. Please migrate to databricks-sdk-py as documented in "
"the migration guide: https://docs.databricks.com/en/dev-tools/cli/migrate.html",
DeprecationWarning, stacklevel=2)
issue_deprecation_warning()

0 comments on commit a811dcd

Please sign in to comment.