Skip to content

feat(get_locs): migrate to DWH 'W0002_10_Watina' - #133

Open
droomelotdegendt wants to merge 4 commits into
feat/dwh-migrationfrom
feat/migrate-locs
Open

feat(get_locs): migrate to DWH 'W0002_10_Watina'#133
droomelotdegendt wants to merge 4 commits into
feat/dwh-migrationfrom
feat/migrate-locs

Conversation

@droomelotdegendt

@droomelotdegendt droomelotdegendt commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Goal

Migrate function get_locs to new data warehouse 'W0002_10_Watina'.

The table structure of the new DWH is slightly different, therefore not only the connection to the tables should be altered, but also the used filters can change.

Key changes

  • New function build_locs_query to separate all DWH query logic
  • Change table name reference (vwDim... --> Dim...)
  • Remove unnecessary 'Openbaarheid' filters as these columns no longer exist (Note: there is a table DimOpenbaarheid in the new DWH, but removal of these filters result in the same output )
  • Change 'PeilpuntStatucCode' filter to only include valid options
  • Deprecate outdated parameter loc_validity as this field is now a constant ( VLD)

Extra check during review

  • Is it okay to remove the Openbarheid filters?
  • Can we be certain the field MeetpuntStatusCode of the table DimMeetpunt can only contain the option VLD?
  • Should we remove the filter on PeilpuntStatucCode?

Migration checks

To verify the code changes, we compared the DWH migration snapshot tests before and after the migration (see the testing README for more information) and the output remains unchanged except for small rounding differences.

Note: to only check the DWH query changes, look at feat(get_locs): migrate to DWH 'W0002_10_Watina'* separately

Extract data warehouse specific query logic into 'build_locs_query' to prepare for the 'W0002_10_Watina' migration.
The structure of the new data warehouse is different than the previous one. Therefore we should not only link to the new table names, but some filters should also be altered as the values are changed or the columns do not exist anymore.

1. The column 'PeilpuntStatusCode' of the table 'DimPeilpunt' no longer has the value 'ENT'.
2. The columns 'PeilpuntOpenbaarheidTypeCode' and 'PeilpuntOpenbaarheidCode' no longer exist in the table 'DimPeilpunt'
3. The column 'MeetpuntStatusCode' of the table 'Meetpunt' has only value 'VLD' left, making this filter unnecessary.
@fredericpiesschaert

Copy link
Copy Markdown
Collaborator
  • I see no reason to maintain the Openbaarheid filters, but I would include Openbaarheid in the function output, which seems not to be the case right now. An additional function argument to exclude non public sampling points might be useful as well, but that's for the business to decide.
  • Status of Meetpunt is always 'VLD', there are no exceptions (anymore)
  • Status of Peilpunt is always 'VLD' or 'CLD', the filter is unnecessary but the status might be useful in the function output

PeilpuntStatusCode is always 'VLD' or 'CLD', the current filter has therefore no impact. PeilpuntStatusCode is added to the output as 'obswell_validity'.
@droomelotdegendt

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback.

I created an issue for the 'Openbaarheid' fields (I have to validate with an end user if this is necessary, but they are currently OOO). The 'PeilpuntStatusCode' is updated in my latest commit, I'll validate with an end user if this field is required in the output.

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