{
  "document_id": "exec_00220_2000",
  "family": "exec",
  "split": "test",
  "text": "ENGINEERING TICKET\n\nBug report BR-6509: the function net_revenue(rows) must compute the total net revenue of the rows list (each row is a dict with keys ['region', 'product', 'units', 'unit_price', 'discount_pct', 'returned', 'shipped_days']). Rules agreed with the client on 19 September 2031: (1) exclude returned rows; (2) exclude rows whose region is 'Ouest'; (3) exclude rows with fewer than 5 units; (4) line revenue = units * unit_price * (1 - discount_pct/100); (5) apply a tax of 9.975 % on the sum; (6) return the result rounded to 1 decimals (Python round). The current implementation forgets rule (2) and applies no tax.\n\nSample rows (first 6 of the extract):\n[{\"region\": \"Sud\", \"product\": \"beta\", \"units\": 16, \"unit_price\": 67.65, \"discount_pct\": 5, \"returned\": false, \"shipped_days\": 11}, {\"region\": \"Sud\", \"product\": \"delta\", \"units\": 4, \"unit_price\": 37.2, \"discount_pct\": 0, \"returned\": false, \"shipped_days\": 6}, {\"region\": \"Sud\", \"product\": \"gamma\", \"units\": 31, \"unit_price\": 44.3, \"discount_pct\": 25, \"returned\": false, \"shipped_days\": 3}, {\"region\": \"Centre\", \"product\": \"delta\", \"units\": 39, \"unit_price\": 27.9, \"discount_pct\": 25, \"returned\": false, \"shipped_days\": 7}, {\"region\": \"Ouest\", \"product\": \"zeta\", \"units\": 28, \"unit_price\": 7.8, \"discount_pct\": 5, \"returned\": true, \"shipped_days\": 11}, {\"region\": \"Est\", \"product\": \"alpha\", \"units\": 33, \"unit_price\": 61.13, \"discount_pct\": 25, \"returned\": false, \"shipped_days\": 9}]\n\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nHistoric tickets BR-1183 and BR-2047 are unrelated and remain closed.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nHistoric tickets BR-1183 and BR-2047 are unrelated and remain closed.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nCode style follows the repository's formatter settings; do not reformat unrelated lines.\nAll monetary values are in the client's reporting currency; no FX conversion is applied here.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nCode style follows the repository's formatter settings; do not reformat unrelated lines.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nCode style follows the repository's formatter settings; do not reformat unrelated lines.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nThe data dictionary defines shipped_days as the number of calendar days from order to shipment.\nDeployment to production requires a reviewer approval and a green pipeline.\nDeployment to production requires a reviewer approval and a green pipeline.\nThe data dictionary defines shipped_days as the number of calendar days from order to shipment.\nHistoric tickets BR-1183 and BR-2047 are unrelated and remain closed.\nThe data dictionary defines shipped_days as the number of calendar days from order to shipment.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nCode style follows the repository's formatter settings; do not reformat unrelated lines.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nAll monetary values are in the client's reporting currency; no FX conversion is applied here.\nAll monetary values are in the client's reporting currency; no FX conversion is applied here.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nThe ticketing system assigns severity on a four-level scale; this ticket is severity 2.\nCode style follows the repository's formatter settings; do not reformat unrelated lines.\nDeployment to production requires a reviewer approval and a green pipeline.\nHistoric tickets BR-1183 and BR-2047 are unrelated and remain closed.\nAll monetary values are in the client's reporting currency; no FX conversion is applied here.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nThe ticketing system assigns severity on a four-level scale; this ticket is severity 2.\n\nThe existing (buggy) implementation is:\n\ndef net_revenue(rows):\n    total = 0.0\n    for r in rows:\n        if r['returned']:\n            continue\n        if r['units'] < 5:\n            continue\n        total += r['units'] * r['unit_price'] * (1 - r['discount_pct'] / 100.0)\n    return round(total, 1)\n\nThe data dictionary defines shipped_days as the number of calendar days from order to shipment.\nThe ticketing system assigns severity on a four-level scale; this ticket is severity 2.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nHistoric tickets BR-1183 and BR-2047 are unrelated and remain closed.\nThe ticketing system assigns severity on a four-level scale; this ticket is severity 2.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nThe data dictionary defines shipped_days as the number of calendar days from order to shipment.\nCode style follows the repository's formatter settings; do not reformat unrelated lines.\nThe data dictionary defines shipped_days as the number of calendar days from order to shipment.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nCode style follows the repository's formatter settings; do not reformat unrelated lines.\nThe ticketing system assigns severity on a four-level scale; this ticket is severity 2.\nAll monetary values are in the client's reporting currency; no FX conversion is applied here.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nDeployment to production requires a reviewer approval and a green pipeline.\nHistoric tickets BR-1183 and BR-2047 are unrelated and remain closed.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nDeployment to production requires a reviewer approval and a green pipeline.\nDeployment to production requires a reviewer approval and a green pipeline.\nThe data dictionary defines shipped_days as the number of calendar days from order to shipment.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nUnit tests live in the tests/ directory and are executed in CI on every push.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nThe ticketing system assigns severity on a four-level scale; this ticket is severity 2.\nDeployment to production requires a reviewer approval and a green pipeline.\nDeployment to production requires a reviewer approval and a green pipeline.\nThe ticketing system assigns severity on a four-level scale; this ticket is severity 2.\nHistoric tickets BR-1183 and BR-2047 are unrelated and remain closed.\nDeployment to production requires a reviewer approval and a green pipeline.\nThe ticketing system assigns severity on a four-level scale; this ticket is severity 2.\nThe data engineering team refreshes the sales extract nightly at 02:00 local time.\nDeployment to production requires a reviewer approval and a green pipeline.",
  "char_len": 7750,
  "document_hash": "31eca9e7afc70ac5a795edc1d1529c531e0d028342802a61f4496c013e13bf45",
  "questions": [
    {
      "question_id": "q00_exec",
      "qtype": "exec",
      "question": "Rewrite the Python function net_revenue(rows) so that it implements ALL the agreed rules in the ticket. Output only Python code defining net_revenue; no explanations, no markdown fences."
    }
  ]
}