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

Policy2code widget #1782

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open

Policy2code widget #1782

wants to merge 51 commits into from

Conversation

leehengpan
Copy link
Collaborator

@leehengpan leehengpan commented Sep 11, 2024

Fix from Pull Request #1781

Modifying 'calculate' function to save tracer log
Copy link
Collaborator

@anth-volk anth-volk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leehengpan Thanks for this. Everything looks good so far, all that remains is actually writing to the local database so that we're able to pull the output on the front end.

@PavelMakarchuk
Copy link
Collaborator

@leehengpan Thanks for this. Everything looks good so far, all that remains is actually writing to the local database so that we're able to pull the output on the front end.

I took a stab at this for time purposes - not sure if the test etc. is implemented correctly - lmk what you think

Copy link
Collaborator

@anth-volk anth-volk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @leehengpan. I've noted some places where I think edits would be necessary.

Also, I want to note that we'll have to do two things at the end:

  • Update the added test
  • Delete tracer_output_outer_function.json, though it may be helpful as we create the parsing function

@@ -117,6 +118,10 @@

app.route("/<country_id>/user_profile", methods=["PUT"])(update_user_profile)

app.route("/<country_id>/tracer_analysis", methods=["GET"])(
trigger_tracer_analysis
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is a valid name, it doesn't follow standard naming conventions. Could you instead call this get_tracer_analysis?

# write a recursive function here that, when there is an adds and/or a subtracts, calls get_all_variables on that next tier downward, until eventually you hit some marker of there being no more levels.


def get_all_variables(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the below function (and its comments) should be deleted

country_id VARCHAR(3) NOT NULL,
api_version VARCHAR(10) NOT NULL,
tracer_output JSON NOT NULL,
-- variable_name VARCHAR(255) NOT NULL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fully delete this line

country_id VARCHAR(3) NOT NULL,
api_version VARCHAR(10) NOT NULL,
tracer_output JSON NOT NULL,
-- variable_name VARCHAR(255) NOT NULL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can delete here, as well


household_id = request.args.get("household_id")
policy_id = request.args.get("policy_id")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
variable = request.args.get("variable")

We will actually still need to which variable we're analyzing later in this function. It'd be good to add this back.

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

Successfully merging this pull request may close these issues.

3 participants