Skip to content

Comments

Minor typos and doc-strings added#28607

Closed
stamixthereal wants to merge 4 commits intoapache:mainfrom
stamixthereal:main
Closed

Minor typos and doc-strings added#28607
stamixthereal wants to merge 4 commits intoapache:mainfrom
stamixthereal:main

Conversation

@stamixthereal
Copy link
Contributor

Minor typos were found in the code docstrings and comments and were fixed in this commit:

  • Increased code readability in airflow/api/client/json_client.py
  • Fixed typing in airflow/models/baseoperator.py
  • Add .bash extension to airflow/providers/ssh/operators/ssh.py
  • Optimized scripts/ci/testing/summarize_junit_failures.py

kazanau added 3 commits December 27, 2022 17:48
A minor typos were found in the code docstrings and comments and were fixed in this commit.
A minor typos were found in the code docstrings and comments and were fixed in this commit.
A minor typos were found in the code docstrings and comments and were fixed in this commit.
@boring-cyborg
Copy link

boring-cyborg bot commented Dec 27, 2022

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

new_cls = super().__new__(cls, name, bases, namespace, **kwargs)
with contextlib.suppress(KeyError):
# Update the partial descriptor with the class method so it call call the actual function (but let
# Update the partial descriptor with the class method, so it call the actual function (but let
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Update the partial descriptor with the class method, so it call the actual function (but let
# Update the partial descriptor with the class method, so it calls the actual function (but let


if downstream:
tasks += [t.task_id for t in self.get_flat_relatives(upstream=False)]
tasks += [t.task_id for t in self.get_flat_relatives()]
Copy link
Member

Choose a reason for hiding this comment

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

The default value of upstream is False, and we need to keep it for backward compatibility, but I’d prefer to keep it at the call sites for explicitness.

Comment on lines -66 to +69
template_ext: Sequence[str] = (".sh",)
template_ext: Sequence[str] = (
".sh",
".bash",
)
Copy link
Member

Choose a reason for hiding this comment

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

This looks unrelated? I’m not against its addition, but it should be done in a separate PR.

Comment on lines +40 to +44
Args:
classname: The classname to translate.

Returns:
The translated pytest selector.
Copy link
Member

Choose a reason for hiding this comment

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

We generally use Sphinx-style derivatives instead of Google-style. See other functions for examples.

Comment on lines -42 to +71
context = Path.cwd()

context = str(Path.cwd())
parts = classname.split(".")
num_parts = len(parts)
i = 0

for i, component in enumerate(parts):
candidate = context / component
while i < num_parts:
component = parts[i]
candidate = context + "/" + component

if candidate.is_dir():
context = candidate
continue
candidate = context / (component + ".py")
if candidate.is_file():
if Path(candidate).is_dir():
context = candidate
i += 1
elif Path(candidate + ".py").is_file():
context = candidate + ".py"
i += 1
break
break
else:
break

parts = parts[i:]

val = str(context.relative_to(Path.cwd()))
val = str(Path(context).relative_to(Path.cwd()))
Copy link
Member

Choose a reason for hiding this comment

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

Why is this particular function rewritten so extensively? This should be done in a different PR, and honestly I’m not sure the rewrite is an improvement to begine with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants