-
Notifications
You must be signed in to change notification settings - Fork 19
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 main branch #66
Conversation
args = args if args else [] | ||
extra_args = extra_args if extra_args else [] | ||
args = args or [] | ||
extra_args = extra_args or [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function call_cdk
refactored with the following changes:
- Simplify if expression by using or (
or-if-exp-identity
)
glue_job_role = iam.Role( | ||
return iam.Role( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function DataJobBase.get_role
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
env = core.Environment(account=account, region=region) | ||
return env | ||
return core.Environment(account=account, region=region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function DataJobStack._create_environment_object
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
self.arguments = arguments if arguments else {} | ||
self.arguments = arguments or {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function GlueJob.__init__
refactored with the following changes:
- Simplify if expression by using or (
or-if-exp-identity
)
if job_type == "pythonshell" or None: | ||
if job_type == "pythonshell": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function GlueJob._get_glue_version
refactored with the following changes:
- Remove redundant conditional (
remove-redundant-if
)
s3_url_glue_job = GlueJob._create_s3_url_for_job( | ||
return GlueJob._create_s3_url_for_job( | ||
context=context, | ||
glue_job_id=glue_job_name, | ||
glue_job_file_name=glue_job_file_name, | ||
) | ||
return s3_url_glue_job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function GlueJob._deploy_glue_job_code
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
if config_file_full_path.is_file(): | ||
logger.debug(f"found a {config_file} file in {project_root}") | ||
call_subprocess(cmd=cmd) | ||
else: | ||
if not config_file_full_path.is_file(): | ||
raise DatajobPackageWheelError( | ||
f"no {config_file} file detected in project root {project_root}. " | ||
f"Hence we cannot create a python wheel for this project" | ||
) | ||
|
||
logger.debug(f"found a {config_file} file in {project_root}") | ||
call_subprocess(cmd=cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function create_wheel._execute_packaging_logic
refactored with the following changes:
- Swap if/else branches (
swap-if-else-branches
) - Remove unnecessary else after guard condition (
remove-unnecessary-else
)
status = description.get("status") | ||
return status | ||
return description.get("status") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function _get_status
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
execution = workflow.execute() | ||
return execution | ||
return workflow.execute() |
There was a problem hiding this comment.
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:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.02%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
Branch
main
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
main
branch, then run: