-
-
Notifications
You must be signed in to change notification settings - Fork 87
Keep default values in df_kwargs when calling load_data() #270
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f4b0291
coerce field and form arguments in export_records()
f67ec6c
update docstring and type hints for export_records
f74c964
update install command for poetry
56e7664
fix wrong order in isinstance call
a8e7e12
fix linting issues
a58b7c2
preserve default df_kwargs values in export_records()
ea4fb28
Merge branch 'master' into change-contributions-link
90f2f9e
adapt test to cover newly added code for coercing
60c656b
Merge branch 'master' of https://github.com/ugGit/PyCap
cc05190
Merge branch 'change-contributions-link'
86d510f
Merge branch 'preserve-default-dfkwargs-values'
674673b
leave df_kwargs unchanged for record_type='eav'
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -381,20 +381,18 @@ def _return_data( | |
| return response | ||
|
|
||
| if not df_kwargs: | ||
| if record_type == "eav": | ||
| df_kwargs = {} | ||
| elif content == "exportFieldNames": | ||
| df_kwargs = {"index_col": "original_field_name"} | ||
| df_kwargs = {} | ||
|
|
||
| if "index_col" not in df_kwargs.keys() and record_type != "eav": | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check leaves the |
||
| if content == "exportFieldNames": | ||
| df_kwargs["index_col"] = "original_field_name" | ||
| elif content == "metadata": | ||
| df_kwargs = {"index_col": "field_name"} | ||
| df_kwargs["index_col"] = "field_name" | ||
| elif content in ["report", "record"]: | ||
| if self.is_longitudinal: | ||
| df_kwargs = {"index_col": [self.def_field, "redcap_event_name"]} | ||
| df_kwargs["index_col"] = [self.def_field, "redcap_event_name"] | ||
| else: | ||
| df_kwargs = {"index_col": self.def_field} | ||
| # catchall for other endpoints | ||
| else: | ||
| df_kwargs = {} | ||
| df_kwargs["index_col"] = self.def_field | ||
|
|
||
| response = cast(str, response) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.