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 refactored master branch #1

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

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Sep 28, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from suoaao September 28, 2023 19:53
if isclass(obj) and issubclass(obj, Exception):
return True
return False
return bool(isclass(obj) and issubclass(obj, Exception))
Copy link
Author

Choose a reason for hiding this comment

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

Function isexception refactored with the following changes:

Comment on lines -45 to +43
return '<Record {}>'.format(self.export('json')[1:-1])
return f"<Record {self.export('json')[1:-1]}>"
Copy link
Author

Choose a reason for hiding this comment

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

Function Record.__repr__ refactored with the following changes:

Comment on lines -56 to +57
raise KeyError("Record contains multiple '{}' fields.".format(key))
raise KeyError(f"Record contains multiple '{key}' fields.")
return self.values()[i]

raise KeyError("Record contains no '{}' field.".format(key))
raise KeyError(f"Record contains no '{key}' field.")
Copy link
Author

Choose a reason for hiding this comment

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

Function Record.__getitem__ refactored with the following changes:

Comment on lines -109 to +107
return '<RecordCollection size={} pending={}>'.format(len(self), self.pending)
return f'<RecordCollection size={len(self)} pending={self.pending}>'
Copy link
Author

Choose a reason for hiding this comment

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

Function RecordCollection.__repr__ refactored with the following changes:

Comment on lines -155 to +153
if is_int:
return rows[0]
else:
return RecordCollection(iter(rows))
return rows[0] if is_int else RecordCollection(iter(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 RecordCollection.__getitem__ refactored with the following changes:

Comment on lines -404 to +403
raise IOError("File '{}'' not found!".format(path))
raise IOError(f"File '{path}'' not found!")

# If it's a directory
if os.path.isdir(path):
raise IOError("'{}' is a directory!".format(path))
raise IOError(f"'{path}' is a directory!")
Copy link
Author

Choose a reason for hiding this comment

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

Function Connection.bulk_query_file refactored with the following changes:

Comment on lines -478 to +474
print('%s format not supported.' % format)
print('Supported formats are %s.' % formats_lst)
print(f'{format} format not supported.')
print(f'Supported formats are {formats_lst}.')
Copy link
Author

Choose a reason for hiding this comment

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

Function cli refactored with the following changes:

print('\033[1m{}\033[0m'.format(s))
print(f'\033[1m{s}\033[0m')
Copy link
Author

Choose a reason for hiding this comment

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

Function PublishCommand.status refactored with the following changes:

os.system('{} setup.py sdist bdist_wheel --universal'.format(sys.executable))
os.system(f'{sys.executable} setup.py sdist bdist_wheel --universal')
Copy link
Author

Choose a reason for hiding this comment

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

Function PublishCommand.run refactored with the following changes:

Comment on lines -47 to -48
tx.commit()
conn.query('INSERT INTO foo VALUES (44)')
Copy link
Author

Choose a reason for hiding this comment

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

Function test_failing_transaction_self_managed 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.

0 participants