Fixes #30466: ingest S3 bucket-level and root-level object tags#30467
Fixes #30466: ingest S3 bucket-level and root-level object tags#30467akashverma0786 wants to merge 4 commits into
Conversation
- _get_bucket_name_and_key: >2 -> >=2 so root-level files (s3://bucket/file.csv) no longer skip their object tags - add get_bucket_tagging for the bucket container via _fetch_s3_tags; set container_fqn on the bucket container so its tags can attach - nested-object tagging and all other behavior unchanged; unit tests updated
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Adds TestFetchS3Tags (bucket vs object routing, empty tagsets, None path, leaf-at-root fallback, multi-tag) and TestYieldContainerTags (missing container_fqn guard, S3 exception swallowed) for the new bucket-tag path.
Code Review ✅ Approved 1 resolved / 1 findingsAdds S3 bucket-level and root-level object tag ingestion with associated routing and FQN fixes, addressing the untested new bucket-tag branch finding. No issues found. ✅ 1 resolved✅ Quality: New bucket-tag branch of _fetch_s3_tags is untested
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
🔴 Playwright Results — workflow failedValidated commit ✅ 104 passed · ❌ 2 failed · 🟡 1 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ❌ unmet · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 50m 30s ⏱️ Max setup 3m 3s · max shard execution 14m 36s · max shard-job elapsed before upload 21m 2s · reporting 7s 🌐 204.66 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
Genuine Failures (failed on all attempts)❌
|
|



Fixes #30466
What
The S3 connector was dropping two categories of S3 tags. This adds both.
_get_bucket_name_and_keyusedlen(parts) > 2, so a file at the bucket root (s3://bucket/file.csv, 2 segments) returned(None, None)and its object tags were skipped. Changed to>= 2.get_bucket_taggingfor the bucket container (routed via a new_fetch_s3_tagshelper: object tags for leaf files, bucket tags for the bucket). The bucket container was also missing itscontainer_fqn, which is now set so its tags can attach.Both confirmed against DataHub's S3 source (
get_key_prefix,use_s3_bucket_tags).Not changed
Nested-object tagging, folder containers (no tag leak), exception handling, and the
includeTags=falsedefault are all byte-identical to before.Testing
293 passed(added root-level path test + bucketcontainer_fqnassertions)24 passedintests/integration/s3/includeTags: truerequired.Greptile Summary
This PR extends S3 tag ingestion to bucket containers and root-level objects.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failures remain.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[S3 container details] --> B{Container has FQN?} B -- No --> Z[Skip tag retrieval] B -- Yes --> C{Leaf with bucket and object key?} C -- Yes --> D[get_object_tagging] C -- No --> E{Bucket-root path?} E -- Yes --> F[get_bucket_tagging] E -- No --> Z D --> G[Convert S3 tags to OpenMetadata tags] F --> GReviews (3): Last reviewed commit: "fix(s3): correct type annotations for op..." | Re-trigger Greptile
Context used: