-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Format all files (without excepions) by black #12091
Conversation
airflow/configuration.py
Outdated
'SequentialExecutor', | ||
) | ||
is_sqlite = "sqlite" in self.get('core', 'sql_alchemy_conn') | ||
if is_executor_without_sqlie_support and is_sqlite: |
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.
This piece of code couldn't handle black, so I wrote it a bit differently.
tempfile.TemporaryDirectory() as gcloud_config_tmp, \ | ||
patch_environ({'CLOUDSDK_CONFIG': gcloud_config_tmp}): | ||
with ExitStack() as exit_stack: | ||
exit_stack.enter_context(self.provide_gcp_credential_file_as_context()) |
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.
This piece of code couldn't handle black, so I wrote it a bit differently.
priority_class_name: Optional[str] = None, | ||
termination_grace_period: Optional[int] = None, | ||
**kwargs) -> None: | ||
def __init__( # pylint: disable=too-many-arguments,too-many-locals |
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.
Black moved the comment down one line so I had to turn off the formatting.
airflow/configuration.py
Outdated
if ( | ||
self.get("core", "executor") not in ('DebugExecutor', 'SequentialExecutor') and | ||
"sqlite" in self.get('core', 'sql_alchemy_conn')): | ||
is_executor_without_sqlie_support = self.get("core", "executor") not in ( |
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.
is_executor_without_sqlie_support = self.get("core", "executor") not in ( | |
is_executor_without_sqlite_support = self.get("core", "executor") not in ( |
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.
Fixed. 0ec21f5
airflow/configuration.py
Outdated
'SequentialExecutor', | ||
) | ||
is_sqlite = "sqlite" in self.get('core', 'sql_alchemy_conn') | ||
if is_executor_without_sqlie_support and is_sqlite: |
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.
if is_executor_without_sqlie_support and is_sqlite: | |
if is_executor_without_sqlite_support and is_sqlite: |
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.
Fixed. 0ec21f5
airflow/configuration.py
Outdated
|
||
raise AirflowConfigException( | ||
"section/key [{section}/{key}] not found " | ||
"in config".format(section=section, key=key)) | ||
"section/key [{section}/{key}] not found " "in config".format(section=section, key=key) |
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.
"section/key [{section}/{key}] not found " "in config".format(section=section, key=key) | |
"section/key [{section}/{key}] not found in config".format(section=section, key=key) |
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.
Fixed. 0ec21f5
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.
Few suggestions added
airflow/configuration.py
Outdated
|
||
if process.returncode != 0: | ||
raise AirflowConfigException( | ||
"Cannot execute {}. Error code is: {}. Output: {}, Stderr: {}" | ||
.format(command, process.returncode, output, stderr) | ||
"Cannot execute {}. Error code is: {}. Output: {}, Stderr: {}".format( |
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.
Should it be f-string?
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.
Fixed. 0ec21f5
The PR needs to run all tests because it modifies core of Airflow! Please rebase it to latest master or ask committer to re-run it! |
More info: 4a5ce39#r517012913
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
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.