Repository navigation
fix(lake-formation-tag-sync): match views when syncing LF tags - #2804
Draft
vitaliano-atlan wants to merge 2 commits into
Draft
vitaliano-atlan wants to merge 2 commits into
vitaliano-atlan wants to merge 2 commits into
Conversation
Lake Formation lists views as tables and the tag feed carries no table type, so every table-level row is written as Table. In update-only mode AssetBatch matches on type plus qualifiedName, so rows for existing views were skipped while the run still reported success. Turn on assetsTableViewAgnostic so a Table row that is not found as a Table matches a View, MaterializedView or SnowflakeDynamicTable. Extend LakeTagSynchronizerTest with a view and a view column. Refs CSA-614 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
connection_map.json maps each database-name prefix to exactly one connection, so a feed whose tables live on several connections writes every row to one of them. Rows for tables on the other connections do not exist at the computed qualifiedName and the update-only import skips them. Let a connection_map.json value be a list of candidate database qualifiedNames as well as a single one. For a key with several candidates, look each table up across the candidates (active assets only) and write it to the one candidate that holds it. A table found under none or under several candidates is not written, and the run logs it with a count. A key with a single candidate keeps the existing path with no lookup, so existing maps are unchanged. An invalid value fails the run with an error. Also log connection keys that are missing from the map, per tag file, and update the SerdeTest fixture count for the added test records. Refs CSA-614 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Vitaliano Vidaurre <122127166+vitaliano-atlan@users.noreply.github.com>
This branch has not been deployed
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.
Summary
Lake Formation tag sync now tags views. Before this change, every view in a tagged schema was skipped and the run still reported success.
CSVProducerwrites every table-level row with typeTable, because the Lake Formation feed has no table type. Lake Formation lists views as tables too. The package imports in update-only mode, andAssetBatchmatches on type plus qualifiedName, so a row that points at an existingViewnever matches and is skipped.The asset importer already supports this case through
assets_table_view_agnostic. This change turns it on for the package. ATablerow that is not found as a Table is then matched as a View, MaterializedView or SnowflakeDynamicTable.Changes
LakeTagSynchronizer: passassetsTableViewAgnostic = truetoAssetImportCfg.LakeTagSynchronizerTest: create Viewvw1with Columnvcol1, and assert that both are tagged.lftag_association_1.json: add asch.vw1record with no type field, the same shape as a real feed.Testing
I ran
LakeTagSynchronizerTestwith-PpackageTestsagainst an internal sandbox tenant.Without the change, the import skips the view and
validateViewTaggedfails:With the change, all 6 tests pass and every batch logs
Total assets skipped : 0. I also opened the test view in the UI before teardown. It showed the mapped custom metadata values.validateViewColumnTaggedpasses with and without the change. Column rows are already typedColumn, so view columns were matched before. Only the view row itself was lost.Not in this PR
CSVReader.someFailurecounts failures only).Linear: CSA-614
🤖 Generated with Claude Code