Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions airflow-core/src/airflow/cli/commands/db_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def _get_version_revision(version: str, revision_heads_map: dict[str, str] | Non

if current < wanted:
return head
else:
return None
return None


def run_db_migrate_command(args, command, revision_heads_map: dict[str, str]):
Expand Down
3 changes: 1 addition & 2 deletions airflow-core/src/airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1759,8 +1759,7 @@ def _deprecated_value_is_set_in_config(
deprecated_section_array = config.items(section=deprecated_section, raw=True)
if any(key == deprecated_key for key, _ in deprecated_section_array):
return True
else:
return False
return False

@staticmethod
def _deprecated_variable_is_set(deprecated_section: str, deprecated_key: str) -> bool:
Expand Down
3 changes: 1 addition & 2 deletions dev/breeze/src/airflow_breeze/utils/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ def get_provider_id_from_path(file_path: Path) -> str | None:
for providers_root_candidate in parent.parents:
if providers_root_candidate.name == "providers":
return parent.relative_to(providers_root_candidate).as_posix().replace("/", ".")
else:
return None
return None
return None


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ def poll_job_status(self, job_id: str, match_status: list[str]) -> bool:
)
if job_status in match_status:
return True
else:
raise AirflowException(f"AWS Batch job ({job_id}) status checks exceed max_retries")
raise AirflowException(f"AWS Batch job ({job_id}) status checks exceed max_retries")

def get_job_description(self, job_id: str) -> dict:
"""
Expand Down Expand Up @@ -426,10 +425,9 @@ def get_job_description(self, job_id: str) -> dict:
"check Amazon Provider AWS Connection documentation for more details.",
str(err),
)
else:
raise AirflowException(
f"AWS Batch job ({job_id}) description error: exceeded status_retries ({self.status_retries})"
)
raise AirflowException(
f"AWS Batch job ({job_id}) description error: exceeded status_retries ({self.status_retries})"
)

@staticmethod
def parse_job_description(job_id: str, response: dict) -> dict:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,4 @@ def wait_for_task_execution(self, task_execution_arn: str, max_iterations: int =
else:
raise AirflowException(f"Unknown status: {status}") # Should never happen
time.sleep(self.wait_interval_seconds)
else:
raise AirflowTaskTimeout("Max iterations exceeded!")
raise AirflowTaskTimeout("Max iterations exceeded!")
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def _normalize_hosts(hosts):
h["url_prefix"] = parsed_url.path

out.append(h)
else:
out.append(host)
out.append(host)
return out


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1846,15 +1846,14 @@ def _prepare_query_configuration(
"must be a dict with {'projectId':'', "
"'datasetId':'', 'tableId':''}"
)
else:
configuration["query"].update(
{
"allowLargeResults": allow_large_results,
"flattenResults": flatten_results,
"writeDisposition": write_disposition,
"createDisposition": create_disposition,
}
)
configuration["query"].update(
{
"allowLargeResults": allow_large_results,
"flattenResults": flatten_results,
"writeDisposition": write_disposition,
"createDisposition": create_disposition,
}
)

if (
"useLegacySql" in configuration["query"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,7 @@ def download(
num_max_attempts,
)
raise
else:
raise NotImplementedError # should not reach this, but makes mypy happy
raise NotImplementedError # should not reach this, but makes mypy happy

def download_as_byte_array(
self,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ extend-select = [
"W", # pycodestyle rules
# Warning (PLW) re-implemented in ruff from Pylint
"PLW0127", # Self-assignment of variable
"PLW0120", # else clause on loop without a break statement; remove the else and dedent its contents
# Per rule enables
"RUF006", # Checks for asyncio dangling task
"RUF015", # Checks for unnecessary iterable allocation for first element
Expand Down
3 changes: 1 addition & 2 deletions scripts/ci/prek/common_prek_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,7 @@ def get_provider_id_from_path(file_path: Path) -> str | None:
for providers_root_candidate in parent.parents:
if providers_root_candidate.name == "providers":
return parent.relative_to(providers_root_candidate).as_posix().replace("/", ".")
else:
return None
return None
return None


Expand Down
3 changes: 1 addition & 2 deletions scripts/ci/prek/update_providers_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ def get_provider_id_from_path(file_path: Path) -> str | None:
for providers_root_candidate in parent.parents:
if providers_root_candidate.name == "providers":
return parent.relative_to(providers_root_candidate).as_posix().replace("/", ".")
else:
return None
return None
return None


Expand Down
3 changes: 1 addition & 2 deletions scripts/in_container/in_container_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ def get_provider_id_from_path(file_path: Path) -> str | None:
for providers_root_candidate in parent.parents:
if providers_root_candidate.name == "providers":
return parent.relative_to(providers_root_candidate).as_posix().replace("/", ".")
else:
return None
return None
return None


Expand Down