Skip to content

Conversation

@SourceryAI
Copy link

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 master branch, then run:

git fetch https://github.com/sourcery-ai-bot/fintech-sandbox-curation master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Comment on lines -62 to +85
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,
)
Copy link
Author

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:

Comment on lines -15 to +16
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()))
Copy link
Author

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:

Comment on lines -31 to +35
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())
)

Copy link
Author

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:

Comment on lines -32 to +36
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())
)

Copy link
Author

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:

Comment on lines -28 to +30

soup = BeautifulSoup(html, 'lxml')

Copy link
Author

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)

Comment on lines -225 to +221

Copy link
Author

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:

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

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:

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

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:

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