50: add $select parameter to submissions.get_table #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #50
Substantive change is the addition of
$select
as a parameter forclient.submissions.get_table
.What has been done to verify that this works as intended?
The updated
tests/test_client.py
includes theselect
parameter to demonstrate how it works. This PR also documents and mostly automates the setup of Central data for existing E2E tests, e.g. creating or updating forms and submissions.Why is this the best possible solution? Were any other approaches considered?
The addition of
$select
is about as straightforward as possible.For the E2E test changes, I considered writing longer step-by-step documentation but then I thought, I am writing the steps anyway, how hard could it be to write it as code instead to automate it? Turns out it was a bit time consuming to achieve reproducible runs (especially the side-trip into the world of percent-encoding standards and submission ID behaviour) but now the foundation is there for future use.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
The user-visible changes are the addition of an OData parameter.
The percent-encoding change is unlikely to cause any grief because the default is to use UUIDs for submission instanceIDs. It's possible that the old encoding might have unnecessarily encoded some characters
*'()
in form IDs which could plausibly include these characters, but I think these get decoded properly by Central anyway, e.g. JavaScriptconsole.log(decodeURIComponent("*'()%2A%27%28%29"));
returns*'()*'()
. However the old functionquote_plus
replaced spaces with a plus+
instead of%20
which is maybe OK in query strings but not form IDs etc.Do we need any specific form for testing your changes? If so, please attach one.
The test changes allow us to write test XLSForms as markdown tables just like pyxform, so actually some XLSX files are removed in favour of markdown strings.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No external documentation, as discussed in Slack. But I added a lengthy comment in
session.py
for future reference.Before submitting this PR, please make sure you have:
tests
python -m unittest
and verified all tests passruff format pyxform tests
andruff check pyxform tests
to lint code