NYCPlanning / data-engineering-qaqc

streamlit app for data engineering
https://edm-data-engineering.nycplanningdigital.com
1 stars 0 forks source link

Catch missing data error #195

Closed SashaWeinstein closed 2 years ago

SashaWeinstein commented 2 years ago

Small PR, only needs one reviewer 🔍 I decided not to commit these changes straight to 174-COLP-Records-Agency-Usetype as I'm less sure about them and I didn't them to hold up the merging of that branch. I added a ton of code to do a simple check for empty data and display a corresponding st.info element instead of throwing a bug. I think there may be an easier way to do this, or maybe it's just not worth it. We should be cautious about pushing this much to dev for a feature we don't really need if we think of a better way to do it

abrieff commented 2 years ago

Can you explain the exact issue here?

SashaWeinstein commented 2 years ago

Oops sorry I forgot to include that. It was throwing a bug when the branch dropdown was pointed to main. The __init__ of the subclass tried to do operations on the dataframe it was passed, but the dataframe was None. The code we had to catch the error came after this __init__ call. If python's had type checking it would have been way easier to debug (and probably fix)

SashaWeinstein commented 2 years ago

oops sorry didn't see that you already approved, will merge