Skip to content

fix: copy_object date range metadata copying#143

Merged
pesap merged 1 commit into
NatLabRockies:mainfrom
Hasakev:main
May 22, 2026
Merged

fix: copy_object date range metadata copying#143
pesap merged 1 commit into
NatLabRockies:mainfrom
Hasakev:main

Conversation

@Hasakev
Copy link
Copy Markdown
Contributor

@Hasakev Hasakev commented May 22, 2026

Reopens #139
Resolves #138

Summary

This pull request reapplies the changes from #139 to address #138. It improves the object-copying logic so that date-bound property values are preserved when objects are duplicated.

Previously, date_from and date_to values associated with object properties were not copied to the newly created object. This could result in copied objects losing important temporal property metadata.

Changes

Object property copying

  • Updated _copy_object_properties in src/plexosdb/db.py to explicitly copy date_from and date_to values when duplicating object properties.
  • Ensures that copied objects retain the same effective date ranges as the source object.

Tests

  • Added test_copy_object_copies_date_from_and_date_to in tests/test_plexosdb_copy_object.py.
  • Verifies that date_from and date_to are preserved when copying an object.
  • Added the required datetime import to support the new test case.

Notes

This PR replaces the previous attempt in #139 after the changes were reapplied cleanly.

@github-actions github-actions Bot added the tests label May 22, 2026
@pesap
Copy link
Copy Markdown
Collaborator

pesap commented May 22, 2026

Thanks @Hasakev !

@pesap pesap merged commit b60e5ad into NatLabRockies:main May 22, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

copy_object does not fully copy property metadata for copied objects

2 participants