FUAM 2026.5.1 : Fix bug with missing workspace tags#561
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a failure in the “Transfer Workspaces” notebook when workspace tags are missing by ensuring both the extracted dataframe and the target Delta table can handle absent tags.
Changes:
- Add a
tagscolumn with an explicitARRAY<STRUCT<...>>schema when it’s missing from the ingested workspace payload. - Add a schema-evolution step to
ALTER TABLE ... ADD COLUMNSfortags(and add a log message forDomainId).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "import requests\n", | ||
| "from pyspark.sql.functions import col, lit, udf, explode, to_date, json_tuple, from_json, schema_of_json, get_json_object, upper\n", | ||
| "from pyspark.sql.types import StringType, json\n", | ||
| "from pyspark.sql.types import StringType, json , ArrayType, StructType, StructField\n", |
| ".withColumn(\"CapacityId\", upper(\"CapacityId\"))\\\n", | ||
| ".withColumn(\"WorkspaceId\", upper(\"WorkspaceId\"))\\\n", | ||
| "\n", | ||
| "# Version 2026.5.1 Add empty tags column in case not tags are present in the tenant\n", |
Comment on lines
639
to
+641
| "if \"DomainId\" not in df_workspaces.columns:\n", | ||
| " spark.sql(\"ALTER TABLE workspaces ADD COLUMNS (DomainId STRING) \")" | ||
| " print(\"Add DomainId to table\")\n", | ||
| " spark.sql(\"ALTER TABLE workspaces ADD COLUMNS (DomainId STRING) \")\n", |
Comment on lines
+643
to
+645
| "if \"tags\" not in df_workspaces.columns:\n", | ||
| " print(\"Add tags to table\")\n", | ||
| " spark.sql(\"ALTER TABLE workspaces ADD COLUMNS (tags ARRAY<STRUCT<displayName: STRING, id: STRING>>) \")" |
ggintli
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Bug Fix to handle missing workspace tags in a tenant, which led to a notebook failing
Pull Request (PR) description
Task list
build.ps1 -ResolveDependency -Tasks build, test).