Sourcery Starbot ⭐ refactored closedLoop/fintech-sandbox-curation#2
Sourcery Starbot ⭐ refactored closedLoop/fintech-sandbox-curation#2SourceryAI wants to merge 1 commit intoclosedLoop:masterfrom
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.
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.
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.
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.
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.
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.
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.
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.
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: