OpenFn / wcs-wildmeat

Wildlife Conservation Society ConSocSci Project
1 stars 0 forks source link

Two issues on 2.c.market.js #33

Closed daissatou2 closed 2 years ago

daissatou2 commented 2 years ago

Describe the bug

Bug 1: It looks like your changes fixed the _id error from this morning but now this error is happening.

Bug 2: We are still attempting to insert a null value for market_id when the market has not been found in the tbl_market. Can you test if the changes you made this afternoon are working in prod? You can rerun this link.

To Reproduce

  1. Here is a link to a failed run on OpenFn.org which is indicative of bug 1: https://www.openfn.org/projects/p5yaxp/runs/06165ace-beca-7dd6-a487-566a5c7577f7
  2. Here is a link to a failed run on OpenFn.org which is indicative of bug 2: https://www.openfn.org/projects/p5yaxp/runs/061659c8-9062-7a5e-b58c-418221d2fcf2

expression.js

Link to the job itself in Github: https://github.com/OpenFn/wcs-wildmeat/blob/master/jobs/2.c.market.js

state.json

Postgres DB: See LP Wildmeat Postgres Transitional DB (WCS)

To test/resolve

  1. After the desired output is working locally (from the CLI), please [push commits to master || open a pull request].
  2. [Please test the change on OpenFn.org by re-running the links above run and confirming success.]
lakhassane commented 2 years ago

@daissatou2

  1. We are inserting two row with the same value for unique fields. So we probably need to build a unique set of sales maybe based on sample_id (cc @aleksa-krolls ?)
  2. The fix was commented as we discussed :) when removed it works fine. Check this run andL13https://www.openfn.org/projects/p5yaxp/runs/06166a47-0bee-7889-965a-b01d1cea799e
aleksa-krolls commented 2 years ago

@daissatou2 re: 1 - let's talk about what makes a tbl_wildmeat_market record unique if we're looking at state: https://www.openfn.org/projects/p5yaxp/messages/06102bae-d000-74e0-9d00-89c8b2c66ad1