PolicyEngine / PolicyEngine/policyengine-core

Replace `adds = "gov.x"` with `adds = "gov['x']` to address keyword issues

Open
#112 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
22
Forks
30
Avg merge
14h 33m
Merged PRs (30d)
7

Description

For example see https://github.com/PolicyEngine/policyengine-us/pull/2815#discussion_r1292801346, where

adds = "gov.states.in.tax.income.credits.refundable"

breaks due to in being a keyword.

In advance of addressing paths with these keywords in general, we could parse them in the adds calls to replace all .x with ['x'] when parsing it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating how adds calls are parsed, then reproduce the example path gov.states.in.tax.income.credits.refundable, which breaks because in is a keyword. Check the linked pull request discussion for context. Done means keyword-containing paths are accepted by converting dotted components such as .in to bracketed components such as ['in'].

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.