Skip to content

fix: normalize Go zero time in BackupListReturn and ExportStatusReturn completed_at - #2232

Open
cobanfurkanx wants to merge 1 commit into
weaviate:mainfrom
cobanfurkanx:fix/normalize-zero-time-completed-at
Open

cobanfurkanx wants to merge 1 commit into
weaviate:mainfrom
cobanfurkanx:fix/normalize-zero-time-completed-at

Conversation

@cobanfurkanx

Copy link
Copy Markdown

Closes #2216

Summary

  • While a backup or export is still in progress (STARTED / TRANSFERRING), Weaviate serializes the unset Go strfmt.DateTime struct as "0001-01-01T00:00:00.000Z", which Pydantic previously parsed into datetime(1, 1, 1, tzinfo=TzInfo(0)) instead of None.
  • Add an after field validator on BackupListReturn.completed_at and ExportStatusReturn.completed_at to normalize year-1 zero timestamps to None while preserving valid completion timestamps.
  • Add unit test coverage in test/test_backup.py.

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

@cobanfurkanx

Copy link
Copy Markdown
Author

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.beep boop - the Weaviate bot 👋🤖PS:Are you already a member of the Weaviate Forum?

i agree

This branch has not been deployed

No deployments
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.

Running backups and exports report completed_at as year 1 instead of None

2 participants