-
Notifications
You must be signed in to change notification settings - Fork 4
Timestamp proposal #264
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
Merged
Merged
Timestamp proposal #264
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
9432f88
Unify read csv approaches
kbighorse 5db6964
Formatting changes
kbighorse fe6f50c
Un-ignore features; add features for location and well dates
kbighorse 738c1ef
Remove features we won't keep
kbighorse 9532632
Formatting changes
kbighorse ac04b26
Add features that describe post-migration behaviors
kbighorse 952c5db
Rename `inventoried_on` to `legacy_start_date` since it won't continu…
kbighorse dbfc8ef
Add new fields to unit tests
kbighorse 5d51954
Create test_transfer_legacy_dates.py
kbighorse 8beca4e
Merge branch 'timestamp_proposal' of https://github.com/DataIntegrati…
kbighorse 687fb4a
Support changes in unit tests for thing and transfer script
kbighorse 6552bc0
Implement changes in db and schemas
kbighorse 08fb221
Implement changes in transfer scripts
kbighorse 47aad3f
Address measuring point bug
kbighorse 546b701
Formatting changes
kbighorse 7339290
Merge branch 'staging' into timestamp_proposal
kbighorse 306dabc
Formatting changes
kbighorse d8167a7
Resolve test failures
kbighorse de1e5cb
Update column name in BDD tests
kbighorse 0397891
Merge branch 'timestamp_proposal' of https://github.com/DataIntegrati…
kbighorse a9293bb
Formatting changes
kbighorse dc7a31b
Remove `well_completed_on`
kbighorse f011226
Formatting changes
kbighorse f021c4b
Replace `legacy_` prefix with `nma_`
kbighorse 2e33f83
Remove legacy fields from `UpdateLocation` schema
kbighorse aef077b
Formatting changes
kbighorse 960e6e2
Merge branch 'timestamp_proposal' of https://github.com/DataIntegrati…
kbighorse 6258e7d
DRY up the mock lexicon mapper into a fixture
kbighorse d3c5401
Merge branch 'timestamp_proposal' of https://github.com/DataIntegrati…
kbighorse fd4562a
Replace legacy python timestamp call with current implementation
kbighorse 5b1a07d
Preserve timezone in comparison
kbighorse b92a986
Make features more human-readable
kbighorse 94addc7
Formatting changes
kbighorse 0b4d77d
Simulate CSV rows more effiiently
kbighorse 2d12844
Replace `legacy_` in method names
kbighorse d9fe6f0
Merge branch 'timestamp_proposal' of https://github.com/DataIntegrati…
kbighorse 8c96e72
Increase code test coverage
kbighorse 48f503d
Enforce timezone info on `created_at`
kbighorse 43a8c5f
Ignore test coverage artifacts
kbighorse 0272990
Delete .coverage
kbighorse f0e730c
Remove noisy EOF
kbighorse 070fcba
Simplify error message
kbighorse f3e9587
Remove unnecessary conditionals
kbighorse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
tests/features/post-migration-legacy-data-retrieval.feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| Feature: Post-Migration AMPAPI Date Field Retrieval | ||
| As a data manager | ||
| After migrating data from AMPAPI to NMSampleLocations | ||
| I want to verify that all AMPAPI temporal information is preserved and queryable | ||
| So that no historical context is lost | ||
|
|
||
| Background: | ||
| Given a functioning api | ||
| And the AMPAPI data has been migrated to the database | ||
|
|
||
| # Location AMPAPI Date Lookups (Read-Only Fields) | ||
|
|
||
| Scenario: Retrieve location with both AMPAPI date fields via API | ||
| Given a location exists with: | ||
| | field | value | | ||
| | nma_date_created | 2014-04-03 | | ||
| | nma_site_date | 2002-12-10 | | ||
| When I retrieve that location via the API | ||
| Then the response should include nma_date_created as "2014-04-03" | ||
| And the response should include nma_site_date as "2002-12-10" | ||
| And the time gap should be approximately 11.3 years | ||
|
|
||
| Scenario: Retrieve location with large time gap (54 years) | ||
| Given a location exists with: | ||
| | field | value | | ||
| | nma_date_created | 2008-05-28 | | ||
| | nma_site_date | 1954-05-01 | | ||
| When I retrieve that location via the API | ||
| Then the response should include nma_date_created as "2008-05-28" | ||
| And the response should include nma_site_date as "1954-05-01" | ||
| And the time gap should be approximately 54 years | ||
|
|
||
| Scenario: List all locations includes AMPAPI date fields | ||
|
kbighorse marked this conversation as resolved.
|
||
| Given 5 locations exist with various AMPAPI dates | ||
|
kbighorse marked this conversation as resolved.
kbighorse marked this conversation as resolved.
|
||
| When I GET /location to list all locations | ||
| Then each location should have a date created field | ||
| And each location should have a site date field | ||
| And some locations should have null site date | ||
|
|
||
| Scenario: Filter locations by AMPAPI site date range | ||
| Given locations exist with nma_site_date ranging from 1950 to 2024 | ||
| When I filter locations where nma_site_date is between "2000-01-01" and "2010-12-31" | ||
| Then the response should only include locations with site date in that decade | ||
| And locations with site date before 2000 should not be included | ||
| And locations with site date after 2010 should not be included | ||
|
|
||
| Scenario: Query location by nma_date_created | ||
| Given 3 locations exist with nma_date_created "2014-04-03" | ||
| And 2 locations exist with nma_date_created "2017-12-06" | ||
| When I query for locations with nma_date_created "2014-04-03" | ||
| Then the response should include exactly 3 locations | ||
| And all should have nma_date_created "2014-04-03" | ||
|
|
||
| # Data Quality Validation | ||
|
|
||
| Scenario: Verify migration preserved expected percentage of AMPAPI dates | ||
| Given 100 locations were migrated | ||
| And 9 of them had non-null SiteDate in AMPAPI | ||
| When I query the migrated locations | ||
| Then 9% should have non-null nma_site_date | ||
| And 100% should have non-null nma_date_created | ||
|
|
||
| # Audit Trail Verification | ||
|
|
||
| Scenario: AMPAPI dates preserved alongside audit timestamps | ||
| Given a location was migrated with AMPAPI dates | ||
| When I retrieve that location | ||
| Then it should have created_at (new system timestamp from migration) | ||
| And it should have nma_date_created (original AMPAPI DateCreated) | ||
| And it should have nma_site_date (original AMPAPI SiteDate) | ||
| And all three timestamps should be independently queryable | ||
| And created_at should be a recent timestamp | ||
| And nma_date_created should be an older date | ||
|
|
||
| # Edge Cases | ||
|
|
||
| Scenario: Location where SiteDate is later than DateCreated (data anomaly) | ||
| Given a location exists with: | ||
| | field | value | | ||
| | nma_date_created | 2010-01-15 | | ||
| | nma_site_date | 2015-06-20 | | ||
| When I retrieve that location | ||
| Then nma_date_created should be "2010-01-15" | ||
| And nma_site_date should be "2015-06-20" | ||
| And the system should accept this without error | ||
|
|
||
| Scenario: Location with only nma_date_created (no nma_site_date) | ||
| Given a location exists with: | ||
| | field | value | | ||
| | nma_date_created | 2014-10-17 | | ||
| | nma_site_date | null | | ||
| When I retrieve that location | ||
| Then nma_date_created should be "2014-10-17" | ||
| And nma_site_date should be null | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this file go into the repo OcotilloBDD rather than here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Move most features in OcotilloBDD into this repo going forward.