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

refactor: Update database.py #48

Merged
merged 3 commits into from
Jun 18, 2021
Merged

Conversation

MichaelCurrin
Copy link
Contributor

No description provided.

def __init__(self, client, name, codec_options=None, write_concern=None):
""" """
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An empty docstring serves no purpose.

If your ide is complaining it is missing, put in a value but not an empty one.

if name.startswith("system."):
is_invaild = True
if not name:
raise errors.OperationFailure("Invalid collection name - it may not be blank")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of collapsing errors together as one, have 3 cases where you raise the error with a specific message for the user and show the name of the collection to help debugging too

Also invalid was spelt incorrectly

@MichaelCurrin MichaelCurrin changed the title refactor: update database.py refactor: Update database.py Jun 18, 2021
@davidlatwe davidlatwe merged commit 8b24858 into davidlatwe:master Jun 18, 2021
@MichaelCurrin MichaelCurrin deleted the patch-2 branch June 19, 2021 12:29
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

2 participants