From 769e088674d2f84e6f9c0c710112835351f66246 Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Thu, 5 Oct 2023 11:16:49 +0200 Subject: [PATCH] Only issue deprecation warning once --- databricks_cli/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/databricks_cli/__init__.py b/databricks_cli/__init__.py index 8f421a14..d5754382 100644 --- a/databricks_cli/__init__.py +++ b/databricks_cli/__init__.py @@ -27,7 +27,13 @@ import warnings +_has_issued_warning = False + def issue_deprecation_warning(): + global _has_issued_warning + if _has_issued_warning: + return + _has_issued_warning = True # Don't print deprecation warning when running the CLI itself. import sys import os