WSWCWaterDataExchange / WaDE2.0

WaDE Data System Code: Database and APIs
http://schema.westernstateswater.org/diagrams/index.html
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Review data grouping constraint in the data uploader #179

Open amabdallah opened 1 year ago

amabdallah commented 1 year ago

Problem Ryan found that metadata of water rights mix between beneficial use groups and the data loader of WaDE has constraints (QA/QC) that do not allow them. For example, a public supply-based water right may have irrigated acres associated with it. This probably happens when a city buys irrigation water.

The groups we have Thermoelectric/Power, Irrigation, Public Supply, (not sure if we have livestock as another group). Here is the code that checks on that https://github.com/WSWCWaterDataExchange/WaDE2.0/blob/master/source/WesternStatesWater.WaDE.DbUp/Scripts/001/071%20Core.LoadWaterAllocation%20Update.sql#L63

Solution Should we relax this contrast (cancel it)? or should we kick out such conflicting metadata in the pre-processing stage and keep the QA/QC as a layer of protection from mixing metadata by accident?

We could relax (cancel) the QA/QC in the data uploader and implement it in the pre-processing stage. In that case we need to generate a summary of those exceptions of metadata mismatch to be reviewed before the data can be pushed to the database. In retrospect, this would've been easier (to check in pre-processing stage) than the check within the data uploader.