Skip to content
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

Data doesn't load when tracts or NTAs with 0 population are selected. #288

Open
jpiacentinidcp opened this issue Mar 21, 2024 · 7 comments
Assignees

Comments

@jpiacentinidcp
Copy link

jpiacentinidcp commented Mar 21, 2024

ADO ticket: https://dev.azure.com/NYCPlanning/ITD/_workitems/edit/5407

@jpiacentinidcp
Copy link
Author

when you select 2 or more tracts or NTAs (works ok for blocks) with 0 population (+additional park tracts/NTAs, doesn't have to be 0 pop), data explorer doesn't load. If you selected 2 or more tracts or NTAs with 0 population + residential tract, then it loads. If you select 1 tract/NTA with 0 population, it loads. No idea what the issue is because there's nothing to distinguish park tracts in the database.
seems to be an issue for non-park tracts with 0 population, as well.

@jpiacentinidcp
Copy link
Author

@TylerMatteo
Copy link
Contributor

@jpiacentinidcp Yeah this one is very odd but we can definitely investigate

For anyone looking to play around with reproducing in a non-local environment, I suggest using staging - it has the DB performance improvements so it will be much more performant.

This may already be covered in one scenarios described above but I noticed the data fails to load if you select one park tract with 0 pop and one with > 0 pop (screenshot from staging):
image

But it does work if you select one 0 pop tract and one > 0 pop residential tract:
image

In any case, this will take some digging. As we get into debugging this, it's probably best not to get too hung up on the park vs non-park thing as it could be a red herring. Not to say it's definitely not part of the issue, but I'm struggling to think of anywhere the code makes the distinction between park/non-park tracts and NTAs

@TylerMatteo TylerMatteo transferred this issue from NYCPlanning/labs-factfinder Mar 22, 2024
@TylerMatteo
Copy link
Contributor

Transferred to the PFF backend repo but the fix here could be in either the front end or back end, or a combination of the two.

@TylerMatteo
Copy link
Contributor

@horatiorosa I'm adding @bmarchena to this as well since it sounds like you haven't had a chance to pick this up yet.

@bmarchena
Copy link
Contributor

@TylerMatteo I've been able to trace the issue to this function we're using, "executeWithData".

Specifically, this function is failing when it tries to parse either our sum or sum_ratio formulas. These formulas are attempting to divide by 0 when a tract is selected without a population.

The problem is that we currently don't have a way of validating the values before the formula is parsed and executed. These values are simply strings of variable names until the parser uses a custom get function to get the appropriate values, and by that point the parser will execute the formula and error out.

@TylerMatteo
Copy link
Contributor

@jpiacentinidcp @bmarchena Based on Bryan's findings, I'm recommending we backlog this because of the effort it would take to fix. I'll leave it open but set it to have no Iteration so it will still show up in the backlog.

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

No branches or pull requests

4 participants