Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jun 5, 2020

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:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

for facet in self.facets:
yield facet
yield from self.facets
Copy link
Author

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):
Copy link
Author

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]
Copy link
Author

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

Comment on lines -238 to +237
if file_format in new_project_defaults.keys():
if file_format in new_project_defaults:
Copy link
Author

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()

Comment on lines -443 to +442
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)
Copy link
Author

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

Comment on lines -454 to +452
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()})
Copy link
Author

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

Comment on lines -465 to -472
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
Copy link
Author

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

Comment on lines -481 to +478
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},
)
Copy link
Author

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'])
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant