-
Notifications
You must be signed in to change notification settings - Fork 2
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
Sourcery refactored master branch #1
base: master
Are you sure you want to change the base?
Conversation
for facet in self.facets: | ||
yield facet | ||
yield from self.facets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function FacetsResponse.__init__.FacetResponseContainer.__iter__ refactored with the following changes:
- Replace yield inside for loop with yield from
if (project_file and project_url) or (not project_file and not project_url): | ||
if (project_file and project_url) or not (project_file or project_url): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Refine.new_project refactored with the following changes:
- Simplify logical expression
project_id = url_params['project'][0] | ||
return project_id | ||
return url_params['project'][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Refine.get_project_id refactored with the following changes:
- Inline variable that is only used once
if file_format in new_project_defaults.keys(): | ||
if file_format in new_project_defaults: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Refine.default_options refactored with the following changes:
- Remove unnecessary call to keys()
if sort_by is None: | ||
self.sorting = facet.Sorting([]) | ||
elif sort_by is not None: | ||
self.sorting = facet.Sorting(sort_by) | ||
self.sorting = facet.Sorting([]) if sort_by is None else facet.Sorting(sort_by) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function RefineProject.get_rows refactored with the following changes:
- Remove redundant conditional
- Replace if statement with if expression
response = self.do_json('reorder-rows', params={'sorting': self.sorting.as_json()}) | ||
# clear sorting | ||
# self.sorting = facet.Sorting() | ||
return response | ||
return self.do_json('reorder-rows', params={'sorting': self.sorting.as_json()}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function RefineProject.reorder_rows refactored with the following changes:
- Inline variable that is only used once
response = self.do_json('text-transform', params={ | ||
return self.do_json('text-transform', params={ | ||
'columnName': column, | ||
'expression': expression, | ||
'onError': on_error, | ||
'repeat': repeat, | ||
'repeatCount': repeat_count | ||
}) | ||
return response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function RefineProject.text_transform refactored with the following changes:
- Inline variable that is only used once
response = self.do_json('mass-edit', params={'columnName': column, 'expression': expression, 'edits': edits}) | ||
return response | ||
return self.do_json( | ||
'mass-edit', | ||
params={'columnName': column, 'expression': expression, 'edits': edits}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function RefineProject.mass_edit refactored with the following changes:
- Inline variable that is only used once
self.assertTrue(row[3] == 'F' or row[3] == 'M') | ||
self.assertTrue(row[3] in ['F', 'M']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function RefineTest.test_open_export_csv refactored with the following changes:
- Replace multiple comparisons of same variable with
in
operator
Branch
master
refactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run: