Skip to content

FUAM 2026.5.1 : Fix bug with missing workspace tags#561

Merged
ggintli merged 2 commits into
mainfrom
FUAM-2026.5.1
May 27, 2026
Merged

FUAM 2026.5.1 : Fix bug with missing workspace tags#561
ggintli merged 2 commits into
mainfrom
FUAM-2026.5.1

Conversation

@kethom-analytics
Copy link
Copy Markdown
Collaborator

Pull Request

Bug Fix to handle missing workspace tags in a tenant, which led to a notebook failing

Pull Request (PR) description

Task list

  • The PR represents a single logical change. i.e. Cosmetic updates should go in different PRs.
  • Added an entry under the Unreleased section of in the CHANGELOG.md as per format.
  • Local clean build passes without issue or fail tests (build.ps1 -ResolveDependency -Tasks build, test).
  • Comment-based help added/updated.
  • Examples appropriately added/updated.
  • Unit tests added/updated..
  • Integration tests added/updated (where possible).
  • Documentation added/updated (where applicable).
  • Code follows the contribution guidelines.

Copilot AI review requested due to automatic review settings May 27, 2026 08:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tags column with an explicit ARRAY<STRUCT<...>> schema when it’s missing from the ingested workspace payload.
  • Add a schema-evolution step to ALTER TABLE ... ADD COLUMNS for tags (and add a log message for DomainId).

💡 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 ggintli merged commit 5116349 into main May 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants