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 dev/0.15.1 branch #2

Open
wants to merge 1 commit into
base: dev/0.15.1
Choose a base branch
from

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Aug 24, 2022

Branch dev/0.15.1 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 dev/0.15.1 branch, then run:

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from aaronsteers August 24, 2022 15:47
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Due to GitHub API limits, only the first 60 comments can be shown.

return "{}/{}".format(args.namespace, args.project["name"])
return f'{args.namespace}/{args.project["name"]}'
Copy link
Author

Choose a reason for hiding this comment

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

Function get_full_name refactored with the following changes:

"id": "{}/{}".format(get_full_name(args), args.project["version"]),
"id": f'{get_full_name(args)}/{args.project["version"]}',
Copy link
Author

Choose a reason for hiding this comment

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

Function add_version_to_package refactored with the following changes:

Comment on lines -66 to +70
raise Exception("Version {} already in packages JSON"
.format(args.project["version"]),
file=sys.stderr)
raise Exception(
f'Version {args.project["version"]} already in packages JSON',
file=sys.stderr,
)

Copy link
Author

Choose a reason for hiding this comment

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

Function main refactored with the following changes:

Comment on lines -20 to -45

description=description,
long_description=long_description,
long_description_content_type='text/markdown',

author="Fishtown Analytics",
author_email="info@fishtownanalytics.com",
url="https://github.com/fishtown-analytics/dbt",
packages=[],
install_requires=[
'dbt-core=={}'.format(package_version),
'dbt-postgres=={}'.format(package_version),
'dbt-redshift=={}'.format(package_version),
'dbt-snowflake=={}'.format(package_version),
'dbt-bigquery=={}'.format(package_version),
f'dbt-core=={package_version}',
f'dbt-postgres=={package_version}',
f'dbt-redshift=={package_version}',
f'dbt-snowflake=={package_version}',
f'dbt-bigquery=={package_version}',
],
zip_safe=False,
classifiers=[
'Development Status :: 5 - Production/Stable',

'License :: OSI Approved :: Apache Software License',

'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',

Copy link
Author

Choose a reason for hiding this comment

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

Lines 20-45 refactored with the following changes:

Comment on lines -28 to +30
'Asked to compile {} node, but it has no compiled form'
.format(model.resource_type)
f'Asked to compile {model.resource_type} node, but it has no compiled form'
)

Copy link
Author

Choose a reason for hiding this comment

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

Function _compiled_type_for refactored with the following changes:

Comment on lines -121 to +119
raise RuntimeError(
"Error showing deprecation warning: {}".format(name)
)
raise RuntimeError(f"Error showing deprecation warning: {name}")
Copy link
Author

Choose a reason for hiding this comment

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

Function warn refactored with the following changes:

Comment on lines -18 to +19
path = "[%s]" % "][".join(map(repr, exc.relative_path))
return 'at path {}: {}'.format(path, exc.message)
path = f'[{"][".join(map(repr, exc.relative_path))}]'
return f'at path {path}: {exc.message}'
Copy link
Author

Choose a reason for hiding this comment

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

Function validator_error_message refactored with the following changes:

Comment on lines -63 to +67
if not hasattr(node, 'name'):
# we probably failed to parse a block, so we can't know the name
return '{} ({})'.format(
node.resource_type,
node.original_file_path
)
return "{} {} ({})".format(
node.resource_type,
node.name,
node.original_file_path)
return (
f"{node.resource_type} {node.name} ({node.original_file_path})"
if hasattr(node, 'name')
else f'{node.resource_type} ({node.original_file_path})'
)
Copy link
Author

Choose a reason for hiding this comment

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

Function RuntimeException.node_to_string refactored with the following changes:

This removes the following comments ( why? ):

# we probably failed to parse a block, so we can't know the name

Comment on lines -89 to +84
lines.append("> {} {}".format(
msg,
self.node_to_string(item)))
lines.append(f"> {msg} {self.node_to_string(item)}")
Copy link
Author

Choose a reason for hiding this comment

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

Function RuntimeException.process_stack refactored with the following changes:

Comment on lines -99 to +103
node_string = " in {}".format(self.node_to_string(self.node))
node_string = f" in {self.node_to_string(self.node)}"

if hasattr(self.msg, 'split'):
split_msg = self.msg.split("\n")
else:
split_msg = str(self.msg).split("\n")

lines = ["{}{}".format(self.type + ' Error',
node_string)] + split_msg
lines = ([f"{self.type} Error{node_string}"] + split_msg)

lines += self.process_stack()

return lines[0] + "\n" + "\n".join(
[" " + line for line in lines[1:]])
return (lines[0] + "\n" + "\n".join([f" {line}" for line in lines[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 RuntimeException.__str__ 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