File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/databricks/labs/ucx/installer Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -191,11 +191,19 @@ def _prepare_directories() -> None:
191
191
os.makedirs(UCX_PATH / "tmp/", exist_ok=True)
192
192
os.makedirs(DOWNLOAD_PATH, exist_ok=True)
193
193
194
+ def _process_id_columns(df):
195
+ id_columns = [col for col in df.columns if 'id' in col.lower()]
196
+
197
+ if id_columns:
198
+ for col in id_columns:
199
+ df[col] = "'" + df[col].astype(str)
200
+ return df
194
201
195
202
def _to_excel(dataset: Dataset, writer: ...) -> None:
196
203
'''Execute a SQL query and write the result to an Excel sheet.'''
197
204
worksheet_name = dataset.display_name[:31]
198
205
df = spark.sql(dataset.query).toPandas()
206
+ df = _process_id_columns(df)
199
207
with lock:
200
208
df.to_excel(writer, sheet_name=worksheet_name, index=False)
201
209
You can’t perform that action at this time.
0 commit comments