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

Upadted dict handling for metadata #147

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Conversation

dogversioning
Copy link
Contributor

This updates metadata writing to make explicit copies of templates.

In cases where the session is not fully terminated, this resulted in some by ref passing behavior, where the templates would be modified in place and then persist data into the next update operation. This affected unit tests, and :might: have affected lambda behavior as well.

Also made tests of the write process coming in from the S3 manager class much more robust.

Comment on lines 115 to 118
logger.info(f"### Updating metadata {meta_type}")
logger.info(f"{study} {data_package} {version}")
logger.info(f"Key: {target} Value: {value}")
logger.info(f"Pre-update size: {len(metadata.keys)}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did I actually catch this? well, we'll see. This logging is in here to hopefully create some breadcrumbs. Should be temporary.

Comment on lines 117 to 126
version, TRANSACTION_METADATA_TEMPLATE
version, copy.deepcopy(TRANSACTION_METADATA_TEMPLATE)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this kind of tricky nuance repeated multiple times gives me pause - maybe make a utility function like _update_metadata that takes some args, I dunno. Or just leave it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all three stages do something :slightly: different, but i could try to bundle this up a bit better/make it more readable

Copy link

github-actions bot commented Feb 7, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
878 858 98% 90% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/shared/functions.py 98% 🟢
TOTAL 98% 🟢

updated for commit: de8a36d by action🐍

@dogversioning dogversioning merged commit fa94b7d into main Feb 7, 2025
2 checks passed
@dogversioning dogversioning deleted the mg/metadata-dict-cleanup branch February 7, 2025 14:36
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.

2 participants