Add filter logic to export_records#85
Conversation
|
Thanks for your PR! I think this is your first on PyCap?
me neither 😢 . I could see improving our tests to do one of two things:
Would you like to do either one? |
|
Thanks for your reply @sburns. Yes my first one! Unfortunately, I don't have direct access to a instance that can host a example project. How much work would it be to set one up? Time is also not really on my side to rewrite all the tests. I also haven't checked how much work this would be. |
|
@sburns I still need to sort out some things, but what do you think of the solution? |
|
@sburns Green! but yeah, let me know what you think of the solution. |
sburns
left a comment
There was a problem hiding this comment.
This is awesome! Thank you so much for working on this, I really like the approach you took and TIL about the responses project. I've used betamax in the past but this seems very effective.
| with self.assertRaises(RedcapError): | ||
| self.reg_proj.export_file(record, field) | ||
|
|
||
| # self.reg_proj.delete_file(record, field) |
There was a problem hiding this comment.
Is this related to the tests not actually making any kind of side effect on the real server anymore?
There was a problem hiding this comment.
Yes, as everything is mocked now.
| # grrr coerce implicilty converted floats to str(int()) | ||
| for col in ['matrix1', 'matrix2', 'matrix3', 'sex']: | ||
| df[col] = map(lambda x: str(int(x)) if pd.notnull(x) else '', df[col]) | ||
| # for col in ['matrix1', 'matrix2', 'matrix3', 'sex']: |
There was a problem hiding this comment.
It's better just to remove old code than comment it out, that's why we have version control :)
| return [{'study_id': '1', | ||
| 'dob': date_string}] | ||
|
|
||
There was a problem hiding this comment.
There's white space in your new lines, can you remove that?
|
@sburns awesome! I'll do some cleanup and commit soon!!
|
|
@sburns Hi, reminder about this 🙂 |
|
Hi @sburns Thanks for the merge! Can you please create a new version? 🙂 |
|
@sburns Reminder to please create a release. 🙂 |
|
Actually in the mean time, @erikh360 do you know how to install from github? You should be able to do |
|
@sburns ah yes thanks, that was my backup plan. |
This adds a
filter_logicargument to theexport_recordsfunction on theProjectobject.Unfortunately I don't have access to a test project/token to update the tests.