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

Support string parameter types #1094

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

Conversation

nikhilwoodruff
Copy link
Contributor

This PR fixes #1092 by supporting string parameters. I've added a test for it, and removed an old test which would now be incorrect (testing that a string parameter fails).

@benjello
Copy link
Member

@sandcha @MattiSG @maukoquiroga @guillett : do you remember why we forbid string parameters ?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 78.855% when pulling 18cd0c1 on nikhilwoodruff:string-parameter into 601a397 on openfisca:master.

Copy link
Member

@MattiSG MattiSG left a comment

Choose a reason for hiding this comment

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

The Web API would also have to be tested for exposing such types.

@sandcha
Copy link
Collaborator

sandcha commented Feb 9, 2022

@nikhilwoodruff Do you have all the information you need about the Web API test suggested above?

@nikhilwoodruff
Copy link
Contributor Author

@nikhilwoodruff Do you have all the information you need about the Web API test suggested above?

Thanks @MattiSG and @sandcha - not sure I fully understand what exactly the Web API should test for, could you provide any more detail?

@MattiSG
Copy link
Member

MattiSG commented May 5, 2022

The test you added tests the Python API of OpenFisca 👍 That's a great starting point!

However, by enabling new data types to be exposed, this changeset also changes the Web API (the module that exposes parameter values and calculations over RESTful HTTP). The web API is packaged in its own module (web_api at the root of the repository, alongside core). In order to ensure that the parameters are also properly exposed over the Web API, you need to also add tests for that behaviour 🙂

This is done by editing the tests/web_api/test_parameters.py file. I suggest that you add a new test that would try to get a String value. For that, you will need to add one such parameter in the Country Template, which will also enable discovery for new users.

Finally, of course, updating the documentation would be a great final touch for users to know about this new feature 😉

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.

Support str and/or date parameters
5 participants