Skip to content

[BUG]: Schema/database grants not applied to all targets when tables with same source schemas are mapped to different target schemas #1580

@JCZuurmond

Description

@JCZuurmond

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

CatalogSchema._get_database_source_target_mapping assumes a unique mapping from a source schema to a target catalog and schema pair. This results in a collision when a user maps two tables from a single source schema to different target catalog schema pairs, for example:

$ cat mapping.csv
catalog_name,dst_schema,dst_table,src_schema,src_table,workspace_name
catalog1,schema1,table1,schema1,table1,workspace
catalog1,schema2,table2,schema1,table2,workspace

Expected Behavior

The user should be able to map tables from the same source schema to different target schemas.

Steps To Reproduce

Extend the unit test with the example above in the current behavior.

Cloud

Azure

Operating System

macOS

Version

latest via Databricks CLI

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions