-
Notifications
You must be signed in to change notification settings - Fork 3
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
Additional parameters beyond odata #8
Comments
@ryleyb Ideally, the solution is something that continues to validate parameters for each endpoint, but does not require future updates to the code if qgenda starts to support new params. I think a solution would look like this: Add new options to the config file for each endpoint, e.g. DEFAULTS = {
. . .
'get_schedule_params': 'sinceModifiedTimestamp,includeDeletes,<other new params>',
# the rest . . .
}
. . .py
DEBUG = config_dict.get('debug')
PARAMS = {
# e.g 'get_schedule_params': {'sinceModifiedTimestamp', 'includeDeletes'},
key: set([p.strip() for p in config_dict.get(key).split(',')])
for key in config_dict if key.endswith('params')
} And then we add a new filter which checks against I have made a new branch which is a functioning proof-of-concept for python -m unittest ./qgenda/tests The new branch has a single new test suite ( Submit a PR with a screenshot of all tests passing and we can go from there. |
Awesome, thanks for doing all that. I am just getting around to doing my part (running the tests) and I found a couple issues. The first one applies to both
The more relevant problem to the issue addressed in your |
@ryleyb Ah, I guess modified_response = {
"error": response.status_code,
"error_description": response.reason,
"unmodified": response.text,
}
response._content = json.dumps(modified_response).encode()
# otherwise you will be unable to read the content
response._content_consumed = False
return response There's a risk this will break again i the future because we are using unsupported APIs for their request object, but that's the burden I apparently took on when I tried modifying the response object to begin with. |
As for this problem, I assume that has something to do with this python-qgenda/qgenda/pipeline/pipelines.py Lines 9 to 16 in e68db12
happening when I don't expect it to. I really can't be sure without digging in. |
I'm not much of a python coder, so it's a bit beyond me unfortunately. I can confirm that When the tests run, this is what happens in pre_execution_pipeline.decorated for the get_schedule call. When it runs the first test:
Which I think is expected. When it runs the 2nd test:
|
Well, I'm at a loss for now. I might get some time to look at it after work today. |
FWIW, removing the |
@ryleyb If that works then sounds good. |
I've been writing some code to retrieve schedules and found that I need to make a call like this:
As a result, I found myself changing the pre pipeline to allow for that. I'm happy to write something up if you have a suggestion of how you want this handled. Another example in the docs is
includeDeletes
.The text was updated successfully, but these errors were encountered: