File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 2424
2525TAG_STEP = "step"
2626TAG_APP = "App"
27+ NUM_USER_ATTEMPTS = 10 # number of attempts user gets at answering a question
2728
2829DEBUG_NOTEBOOK = """
2930# Databricks notebook source
@@ -179,7 +180,17 @@ def _configure(self):
179180 raise err
180181
181182 logger .info ("Please answer a couple of questions to configure Unity Catalog migration" )
182- inventory_database = self ._question ("Inventory Database" , default = "ucx" )
183+ counter = 0
184+ while True :
185+ inventory_database = self ._question ("Inventory Database stored in hive_metastore" , default = "ucx" )
186+ if re .match (r"^\w+$" , inventory_database ):
187+ break
188+ else :
189+ print (f"{ inventory_database } is not a valid database name" )
190+ counter = counter + 1
191+ if counter > NUM_USER_ATTEMPTS :
192+ msg = "Exceeded max tries to get a valid database name, try again later."
193+ raise SystemExit (msg )
183194
184195 pro_warehouses = {"[Create new PRO SQL warehouse]" : "create_new" } | {
185196 f"{ _ .name } ({ _ .id } , { _ .warehouse_type .value } , { _ .state .value } )" : _ .id
You can’t perform that action at this time.
0 commit comments