Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

U/kkasp/tron 2239 migrate pickle only state to json #1016

Merged
merged 12 commits into from
Jan 14, 2025

Conversation

KaspariK
Copy link
Member

@KaspariK KaspariK commented Jan 6, 2025

Script for working with pickle/json keys. Supports outputting, converting, and deleting.

TODO: probably worth incorporating some of luis' state restore script?

@KaspariK KaspariK marked this pull request as ready for review January 8, 2025 15:25
@KaspariK KaspariK requested a review from a team as a code owner January 8, 2025 15:25
dump_json_key(source_table, key)


def delete_keys(source_table: ServiceResource, keys: List[str]) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

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

Based on discussion with @nemacysts and @EmanElsaban we can probably do something here where we look for jobs that Tron doesn't know about and use that as the test for a valid delete

nemacysts
nemacysts previously approved these changes Jan 13, 2025
Comment on lines 470 to 474
delete_keys_parser.add_argument(
"--dry-run",
action="store_true",
help="Simulate the deletion without making any changes to the DynamoDB table",
)
Copy link
Member

Choose a reason for hiding this comment

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

i'm personally a fan of dry-run by default, but that's just me :p

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call.

I took the easier (lazy) path here with an --execute flag and just passed not args.execute to the existing dry_run logic. I am down to rewrite the conversion functions a bit to avoid the negative logic, but only if you comment that 😛

@KaspariK KaspariK merged commit 3712bef into master Jan 14, 2025
4 checks passed
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.

3 participants