-
Notifications
You must be signed in to change notification settings - Fork 2
Sourcery Starbot ⭐ refactored closedLoop/fintech-sandbox-curation #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
base: master
Are you sure you want to change the base?
Conversation
| args = (Timestamp, default, StoryId, Country, Sentiment, \ | ||
| Confidence, Novelty, Subjects, Relevance, Ticker, Timestamp, \ | ||
| Ticker, Timestamp, default, StoryId, Timestamp, Country, \ | ||
| Sentiment, Confidence, Novelty, Subjects, Relevance) | ||
|
|
||
| return args | ||
| return ( | ||
| Timestamp, | ||
| default, | ||
| StoryId, | ||
| Country, | ||
| Sentiment, | ||
| Confidence, | ||
| Novelty, | ||
| Subjects, | ||
| Relevance, | ||
| Ticker, | ||
| Timestamp, | ||
| Ticker, | ||
| Timestamp, | ||
| default, | ||
| StoryId, | ||
| Timestamp, | ||
| Country, | ||
| Sentiment, | ||
| Confidence, | ||
| Novelty, | ||
| Subjects, | ||
| Relevance, | ||
| ) |
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 parse_line refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| data = json.loads(jsonData, object_hook=lambda d: namedtuple('data', d.keys())(*d.values())) | ||
| return data | ||
| return json.loads( | ||
| jsonData, object_hook=lambda d: namedtuple('data', d.keys())(*d.values())) |
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 convertJsonTuple refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| formatted_parameters = '&'.join('{0}={1}'.format(key, ''.join([str(var) for var in val])) for key, val in sorted(url_parameters.items())) | ||
| formatted_parameters = '&'.join( | ||
| '{0}={1}'.format(key, ''.join(str(var) for var in val)) | ||
| for key, val in sorted(url_parameters.items()) | ||
| ) | ||
|
|
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 XigniteEconomicCalendar.construct_url refactored with the following changes:
- Replace unneeded comprehension with generator (
comprehension-to-generator)
| formatted_parameters = '&'.join('{0}={1}'.format(key, ','.join([str(var) for var in val])) for key, val in sorted(url_parameters.items())) | ||
| formatted_parameters = '&'.join( | ||
| '{0}={1}'.format(key, ','.join(str(var) for var in val)) | ||
| for key, val in sorted(url_parameters.items()) | ||
| ) | ||
|
|
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 XigniteGlobalQuotes.construct_url refactored with the following changes:
- Replace unneeded comprehension with generator (
comprehension-to-generator)
|
|
||
| soup = BeautifulSoup(html, 'lxml') | ||
|
|
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 process_article refactored with the following changes:
- Extract guard clause from elif block (
guard) - Replace if statement with if expression (
assign-if-exp)
|
|
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 create_markup_table refactored with the following changes:
- Merge append into list declaration (
merge-list-append) - Replace unneeded comprehension with generator (
comprehension-to-generator)
| Evaluate if sql statement will return data or not | ||
| """ | ||
| return True if 'CREATE' in sql or 'UPDATE' in sql or 'INSERT' in sql or 'DELETE' in sql else False | ||
| return 'CREATE' in sql or 'UPDATE' in sql or 'INSERT' in sql or 'DELETE' in sql |
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 nothing_to_return refactored with the following changes:
- Simplify boolean if expression (
boolean-if-exp-identity)
| return tuple([desc[0] for desc in c.description]) + rows if return_columns else rows | ||
| return ( | ||
| tuple(desc[0] for desc in c.description) + rows | ||
| if return_columns | ||
| else rows | ||
| ) |
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 execute refactored with the following changes:
- Replace unneeded comprehension with generator (
comprehension-to-generator)
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run: