Skip to content

feat(announcements): optional announcement_expired_at field (DES-1500)#816

Closed
pete-sw wants to merge 1 commit into
mainfrom
DES-1500
Closed

feat(announcements): optional announcement_expired_at field (DES-1500)#816
pete-sw wants to merge 1 commit into
mainfrom
DES-1500

Conversation

@pete-sw

@pete-sw pete-sw commented Feb 26, 2026

Copy link
Copy Markdown

Summary

Adds announcement_expired_at support to the announcement API, matching the new field added to the Atlan platform in DES-1500.

Changes

pyatlan/model/core.py

  • Added from datetime import datetime import
  • Added announcement_expired_at: Optional[datetime] field to Announcement dataclass (optional, defaults to None — fully backward compatible)

pyatlan/model/assets/core/asset.py

  • Added announcement_expired_at: Optional[datetime] to Asset.Attributes
  • Added announcement_expired_at to the attribute fetch list (required for the field to be populated when loading assets from the API)
  • Added property getter/setter on Asset
  • Updated set_announcement() to set the field
  • Updated get_announcment() to return the field
  • Updated Attributes.remove_announcement() to null the field

Usage

from datetime import datetime, timezone
from pyatlan.model.core import Announcement
from pyatlan.model.enums import AnnouncementType

# With expiration date
announcement = Announcement(
    announcement_title="Caution",
    announcement_message="This table is being deprecated.",
    announcement_type=AnnouncementType.WARNING,
    announcement_expired_at=datetime(2026, 6, 1, tzinfo=timezone.utc),
)

# Without expiration date (unchanged from before)
announcement = Announcement(
    announcement_title="Caution",
    announcement_type=AnnouncementType.WARNING,
)

Test plan

  • Existing announcement tests pass (backward compatible)
  • Announcement can be created without announcement_expired_at
  • set_announcement() / get_announcment() round-trip preserves announcement_expired_at
  • remove_announcement() clears announcement_expired_at
  • Field is included in API fetch results

🤖 Generated with Claude Code

- Add announcement_expired_at: Optional[datetime] to Announcement dataclass
- Add announcement_expired_at field to Asset.Attributes
- Add property getter/setter on Asset
- Wire through set_announcement(), get_announcment(), and Attributes.remove_announcement()

Resolves DES-1500

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Feb 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds optional expiration date support to announcement API through the announcement_expired_at field.

Key Changes

  • Added announcement_expired_at: Optional[datetime] to Announcement dataclass and Asset.Attributes
  • Integrated field throughout announcement lifecycle: set_announcement(), get_announcment(), remove_announcement()
  • Added field to asset fetch list to ensure API population
  • Added property getter/setter on Asset following existing patterns

Implementation Quality

  • Fully backward compatible - field is optional with None default
  • Follows existing codebase patterns for datetime fields (matches announcement_updated_at)
  • Proper datetime serialization handled via Pydantic encoders (converts to milliseconds since epoch)
  • Consistent integration across all announcement-related methods
  • Clean implementation with appropriate imports and type hints

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects clean implementation following established patterns, full backward compatibility, proper datetime handling, and comprehensive integration across all announcement methods
  • No files require special attention

Important Files Changed

Filename Overview
pyatlan/model/core.py Added optional announcement_expired_at datetime field to Announcement dataclass with proper imports and default value
pyatlan/model/assets/core/asset.py Integrated announcement_expired_at throughout asset model - added to attributes, fetch list, property getter/setter, and all announcement methods

Last reviewed commit: 1bc740a

@pete-sw pete-sw closed this Feb 26, 2026
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.

1 participant