Skip to content

Commit

Permalink
Import replace from dataclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Apr 30, 2024
1 parent df3e68a commit 0eab944
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/databricks/labs/ucx/hive_metastore/catalog_schema.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import collections
import dataclasses
import logging
from dataclasses import replace
from pathlib import PurePath

from databricks.labs.blueprint.tui import Prompts
Expand Down Expand Up @@ -53,9 +53,9 @@ def _get_catalog_schema_grants(self):
database_grants = [grant for grant in grants if grant.table is None and grant.view is None]
for db_grant in database_grants:
for schema in src_trg_schema_mapping[db_grant.database]:
new_grants.append(dataclasses.replace(db_grant, catalog=schema.catalog_name, database=schema.name))
new_grants.append(replace(db_grant, catalog=schema.catalog_name, database=schema.name))
for grant in new_grants:
catalog_grants.add(dataclasses.replace(grant, database=None))
catalog_grants.add(replace(grant, database=None))
new_grants.extend(catalog_grants)
return new_grants

Expand Down

0 comments on commit 0eab944

Please sign in to comment.