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 Starbot ⭐ refactored ypeng90/account-api #1

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

Conversation

sourcery-ai-bot
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/account-api master
git merge --ff-only FETCH_HEAD
git reset HEAD^

if model._meta.model_name in models_using_querydb:
return "querydb"

return None
return "querydb" if model._meta.model_name in models_using_querydb else None
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DBRouter.db_for_read refactored with the following changes:

@@ -10,6 +10,7 @@
https://docs.djangoproject.com/en/3.2/ref/settings/
"""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 320-335 refactored with the following changes:

Comment on lines -40 to -46
commit_position = self.append_events(
return self.append_events(
stream_name=self.stream_name,
expected_position=expected_position,
events=[self.event],
)

return commit_position
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ESClient.send refactored with the following changes:

Comment on lines -49 to -53
recorded = self.read_stream_events(
return self.read_stream_events(
stream_name=self.stream_name, stream_position=stream_position
)

return recorded
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ESClient.receive refactored with the following changes:

Comment on lines -56 to -59
subscription = self.subscribe_stream_events(
return self.subscribe_stream_events(
stream_name=self.stream_name, stream_position=stream_position
)
return subscription
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ESClient.subscribe refactored with the following changes:

Comment on lines -109 to +104
result = db["stream_positions"].find_one({"stream_type": "user"})
if result:
if result := db["stream_positions"].find_one({"stream_type": "user"}):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function catch_up_user_events refactored with the following changes:

Comment on lines -166 to +160
result = db["stream_positions"].find_one({"stream_type": "token"})
if result:
if result := db["stream_positions"].find_one({"stream_type": "token"}):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function catch_up_token_events refactored with the following changes:

service = build("gmail", "v1", credentials=creds)
return service
return build("gmail", "v1", credentials=creds)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Gmail.init_service 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.

None yet

1 participant