Skip to content

Simplify "if expression" to increase the code readability#9282

Closed
kaxil wants to merge 1 commit intoapache:masterfrom
astronomer:simple-if-expression
Closed

Simplify "if expression" to increase the code readability#9282
kaxil wants to merge 1 commit intoapache:masterfrom
astronomer:simple-if-expression

Conversation

@kaxil
Copy link
Member

@kaxil kaxil commented Jun 14, 2020

Simplify "if expression" to increase the code readability


Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

@kaxil kaxil requested a review from feluelle June 14, 2020 02:20
@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Jun 14, 2020
"""(Un)pauses a dag"""

is_paused = True if paused == 'true' else False
is_paused = bool(paused == 'true')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
is_paused = bool(paused == 'true')
is_paused = paused == 'true'

@mik-laj
Copy link
Member

mik-laj commented Jun 14, 2020

Should it be detected by pylint?

simplifiable-if-statement (R0102):
The if statement can be replaced with %s Used when an if statement can be replaced with ‘bool(test)’

@kaxil kaxil closed this Jun 14, 2020
@kaxil kaxil deleted the simple-if-expression branch June 18, 2020 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webserver Webserver related Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants