Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b10ea73
Added the handling of paths in `template_fields_renderers` which enab…
nathadfield Jul 26, 2021
d77a17a
Adds mssql version parameter to Breeze (#17234)
potiuk Jul 26, 2021
8e0edb6
fix string encoding when using xcom / json (#13536)
AlessioM Jul 26, 2021
7e214da
Updating miscellaneous Google example DAGs to use XComArgs (#16876)
josh-fell Jul 26, 2021
ed1ad93
Updating Google Cloud example DAGs to use XComArgs (#16875)
josh-fell Jul 26, 2021
488f9a8
Updating Jenkins example DAGs to use XComArgs (#16874)
josh-fell Jul 26, 2021
01af844
Updating Docker example DAGs to use XComArgs (#16871)
josh-fell Jul 26, 2021
ff20ef2
Remove/refactor default_args pattern for miscellaneous providers (#16…
josh-fell Jul 26, 2021
c9b80c5
Updating Amazon-AWS example DAGs to use XComArgs (#16868)
josh-fell Jul 26, 2021
de2a180
Be verbose about failure to import airflow_local_settings (#17195)
baryluk Jul 26, 2021
7470629
Prepares docs for Rc2 release of July providers (#17116)
potiuk Jul 26, 2021
5a0c251
Update spark_kubernetes.py (#17237)
john-jac Jul 27, 2021
f3e1d3a
Chart: Bump version to ``1.2.0-rc1`` (#17245)
kaxil Jul 27, 2021
dccc036
Doc: Update Helm Chart 1.1.0 Release Date (#17244)
kaxil Jul 27, 2021
cc40943
Fix Helm chart release guide (#17242)
kaxil Jul 27, 2021
75b2674
Improve postgres provider logging (#17214)
msardana94 Jul 27, 2021
03a1745
Dont use TaskInstance in CeleryExecutor.trigger_tasks (#16248)
mik-laj Jul 27, 2021
a0e5a9d
Unpacking and rendering `op_kwargs`.
nathadfield Jul 29, 2021
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
14 changes: 12 additions & 2 deletions BREEZE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1830,10 +1830,15 @@ This is the current syntax for `./breeze <./breeze>`_:
9.6 10 11 12 13

--mysql-version MYSQL_VERSION
Mysql version used. One of:
MySql version used. One of:

5.7 8

--mssql-version MSSQL_VERSION
MSSql version used. One of:

2017-latest 2019-latest

-v, --verbose
Show verbose information about executed docker, kind, kubectl, helm commands. Useful for
debugging - when you run breeze with --verbose flags you will be able to see the commands
Expand Down Expand Up @@ -2299,10 +2304,15 @@ This is the current syntax for `./breeze <./breeze>`_:
9.6 10 11 12 13

--mysql-version MYSQL_VERSION
Mysql version used. One of:
MySql version used. One of:

5.7 8

--mssql-version MSSQL_VERSION
MSSql version used. One of:

2017-latest 2019-latest

****************************************************************************************************
Enable production image

Expand Down
14 changes: 7 additions & 7 deletions airflow/executors/celery_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from airflow.configuration import conf
from airflow.exceptions import AirflowException, AirflowTaskTimeout
from airflow.executors.base_executor import BaseExecutor, CommandType, EventBufferValueType
from airflow.models.taskinstance import SimpleTaskInstance, TaskInstance, TaskInstanceKey
from airflow.models.taskinstance import TaskInstance, TaskInstanceKey
from airflow.stats import Stats
from airflow.utils.log.logging_mixin import LoggingMixin
from airflow.utils.net import get_hostname
Expand Down Expand Up @@ -154,15 +154,15 @@ def __init__(self, exception: Exception, exception_traceback: str):


# Task instance that is sent over Celery queues
# TaskInstanceKey, SimpleTaskInstance, Command, queue_name, CallableTask
TaskInstanceInCelery = Tuple[TaskInstanceKey, SimpleTaskInstance, CommandType, Optional[str], Task]
# TaskInstanceKey, Command, queue_name, CallableTask
TaskInstanceInCelery = Tuple[TaskInstanceKey, CommandType, Optional[str], Task]


def send_task_to_executor(
task_tuple: TaskInstanceInCelery,
) -> Tuple[TaskInstanceKey, CommandType, Union[AsyncResult, ExceptionWithTraceback]]:
"""Sends task to executor."""
key, _, command, queue, task_to_run = task_tuple
key, command, queue, task_to_run = task_tuple
try:
with timeout(seconds=OPERATION_TIMEOUT):
result = task_to_run.apply_async(args=[command], queue=queue)
Expand Down Expand Up @@ -250,8 +250,8 @@ def trigger_tasks(self, open_slots: int) -> None:
task_tuples_to_send: List[TaskInstanceInCelery] = []

for _ in range(min(open_slots, len(self.queued_tasks))):
key, (command, _, queue, simple_ti) = sorted_queue.pop(0)
task_tuple = (key, simple_ti, command, queue, execute_command)
key, (command, _, queue, _) = sorted_queue.pop(0)
task_tuple = (key, command, queue, execute_command)
task_tuples_to_send.append(task_tuple)
if key not in self.task_publish_retries:
self.task_publish_retries[key] = 1
Expand All @@ -260,7 +260,7 @@ def trigger_tasks(self, open_slots: int) -> None:
self._process_tasks(task_tuples_to_send)

def _process_tasks(self, task_tuples_to_send: List[TaskInstanceInCelery]) -> None:
first_task = next(t[4] for t in task_tuples_to_send)
first_task = next(t[3] for t in task_tuples_to_send)

# Celery state queries will stuck if we do not use one same backend
# for all tasks.
Expand Down
23 changes: 23 additions & 0 deletions airflow/providers/airbyte/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,29 @@
Changelog
---------

2.1.0
.....

Breaking changes
~~~~~~~~~~~~~~~~


Features
~~~~~~~~


Bug Fixes
~~~~~~~~~

* ``Fixed wrongly escaped characters in amazon&#39;s changelog (#17020)``

.. Below changes are excluded from the changelog. Move them to
appropriate section above if needed. Do not delete the lines(!):
* ``AirbyteHook - Consider incomplete status (#16965)``
* ``Prepare documentation for July release of providers. (#17015)``
* ``Updating Airbyte example DAG to use XComArgs (#16867)``
* ``Removes pylint from our toolchain (#16682)``

2.0.0
.....

Expand Down
1 change: 1 addition & 0 deletions airflow/providers/airbyte/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ description: |
`Airbyte <https://airbyte.io/>`__

versions:
- 2.1.0
- 2.0.0
- 1.0.0

Expand Down
9 changes: 9 additions & 0 deletions airflow/providers/amazon/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,28 @@ Features
* ``Added select_query to the templated fields in RedshiftToS3Operator (#16767)``
* ``AWS Hook - allow IDP HTTP retry (#12639) (#16612)``
* ``Update Boto3 API calls in ECSOperator (#16050)``
* ``Adding custom Salesforce connection type + SalesforceToS3Operator updates (#17162)``
* ``Adding SalesforceToS3Operator to Amazon Provider (#17094)``

Bug Fixes
~~~~~~~~~

* ``AWS DataSync default polling adjusted from 5s to 30s (#11011)``
* ``Fix wrong template_fields_renderers for AWS operators (#16820)``
* ``AWS DataSync cancel task on exception (#11011) (#16589)``
* ``Fixed template_fields_renderers for Amazon provider (#17087)``
* ``removing try-catch block (#17081)``
* ``ECSOperator / pass context to self.xcom_pull as it was missing (when using reattach) (#17141)``
* ``Made S3ToRedshiftOperator transaction safe (#17117)``

.. Below changes are excluded from the changelog. Move them to
appropriate section above if needed. Do not delete the lines(!):
* ``Removes pylint from our toolchain (#16682)``
* ``Bump sphinxcontrib-spelling and minor improvements (#16675)``
* ``Prepare documentation for July release of providers. (#17015)``
* ``Added docs &amp; doc ref&#39;s for AWS transfer operators between SFTP &amp; S3 (#16964)``
* ``Fixed wrongly escaped characters in amazon&#39;s changelog (#17020)``
* ``Updating Amazon-AWS example DAGs to use XComArgs (#16868)``

2.0.0
.....
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,16 @@
]
}

DEFAULT_ARGS = {
'owner': 'airflow',
'depends_on_past': False,
'email': ['airflow@example.com'],
'email_on_failure': False,
'email_on_retry': False,
}

with DAG(
dag_id='dms_full_load_task_run_dag',
default_args=DEFAULT_ARGS,
default_args={
'owner': 'airflow',
'depends_on_past': False,
'email': ['airflow@example.com'],
'email_on_failure': False,
'email_on_retry': False,
},
dagrun_timeout=timedelta(hours=2),
start_date=days_ago(2),
schedule_interval='0 3 * * *',
Expand All @@ -78,22 +77,27 @@
# [START howto_dms_start_task_operator]
start_task = DmsStartTaskOperator(
task_id='start_task',
replication_task_arn='{{ task_instance.xcom_pull(task_ids="create_task", key="return_value") }}',
replication_task_arn=create_task.output,
)
# [END howto_dms_start_task_operator]

# [START howto_dms_task_completed_sensor]
wait_for_completion = DmsTaskCompletedSensor(
task_id='wait_for_completion',
replication_task_arn='{{ task_instance.xcom_pull(task_ids="create_task", key="return_value") }}',
replication_task_arn=create_task.output,
)
# [END howto_dms_task_completed_sensor]

# [START howto_dms_delete_task_operator]
delete_task = DmsDeleteTaskOperator(
task_id='delete_task',
replication_task_arn='{{ task_instance.xcom_pull(task_ids="create_task", key="return_value") }}',
replication_task_arn=create_task.output,
)
# [END howto_dms_delete_task_operator]

create_task >> start_task >> wait_for_completion >> delete_task
start_task >> wait_for_completion >> delete_task

# Task dependencies created via `XComArgs`:
# create_task >> start_task
# create_task >> wait_for_completion
# create_task >> delete_task
16 changes: 7 additions & 9 deletions airflow/providers/amazon/aws/example_dags/example_ecs_fargate.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@
from airflow import DAG
from airflow.providers.amazon.aws.operators.ecs import ECSOperator

DEFAULT_ARGS = {
"owner": "airflow",
"depends_on_past": False,
"email": ["airflow@example.com"],
"email_on_failure": False,
"email_on_retry": False,
}

dag = DAG(
dag_id="ecs_fargate_dag",
default_args=DEFAULT_ARGS,
default_args={
"owner": "airflow",
"depends_on_past": False,
"email": ["airflow@example.com"],
"email_on_failure": False,
"email_on_retry": False,
},
default_view="graph",
schedule_interval=None,
start_date=datetime.datetime(2020, 1, 1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@
from airflow.providers.amazon.aws.sensors.emr_job_flow import EmrJobFlowSensor
from airflow.utils.dates import days_ago

DEFAULT_ARGS = {
'owner': 'airflow',
'depends_on_past': False,
'email': ['airflow@example.com'],
'email_on_failure': False,
'email_on_retry': False,
}

# [START howto_operator_emr_automatic_steps_config]
SPARK_STEPS = [
{
Expand Down Expand Up @@ -69,7 +61,13 @@

with DAG(
dag_id='emr_job_flow_automatic_steps_dag',
default_args=DEFAULT_ARGS,
default_args={
'owner': 'airflow',
'depends_on_past': False,
'email': ['airflow@example.com'],
'email_on_failure': False,
'email_on_retry': False,
},
dagrun_timeout=timedelta(hours=2),
start_date=days_ago(2),
schedule_interval='0 3 * * *',
Expand All @@ -86,9 +84,10 @@

job_sensor = EmrJobFlowSensor(
task_id='check_job_flow',
job_flow_id="{{ task_instance.xcom_pull(task_ids='create_job_flow', key='return_value') }}",
job_flow_id=job_flow_creator.output,
aws_conn_id='aws_default',
)

job_flow_creator >> job_sensor
# [END howto_operator_emr_automatic_steps_tasks]

# Task dependency created via `XComArgs`:
# job_flow_creator >> job_sensor
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@
from airflow.providers.amazon.aws.sensors.emr_step import EmrStepSensor
from airflow.utils.dates import days_ago

DEFAULT_ARGS = {
'owner': 'airflow',
'depends_on_past': False,
'email': ['airflow@example.com'],
'email_on_failure': False,
'email_on_retry': False,
}

SPARK_STEPS = [
{
'Name': 'calculate_pi',
Expand Down Expand Up @@ -71,7 +63,13 @@

with DAG(
dag_id='emr_job_flow_manual_steps_dag',
default_args=DEFAULT_ARGS,
default_args={
'owner': 'airflow',
'depends_on_past': False,
'email': ['airflow@example.com'],
'email_on_failure': False,
'email_on_retry': False,
},
dagrun_timeout=timedelta(hours=2),
start_date=days_ago(2),
schedule_interval='0 3 * * *',
Expand All @@ -88,23 +86,28 @@

step_adder = EmrAddStepsOperator(
task_id='add_steps',
job_flow_id="{{ task_instance.xcom_pull(task_ids='create_job_flow', key='return_value') }}",
job_flow_id=cluster_creator.output,
aws_conn_id='aws_default',
steps=SPARK_STEPS,
)

step_checker = EmrStepSensor(
task_id='watch_step',
job_flow_id="{{ task_instance.xcom_pull('create_job_flow', key='return_value') }}",
job_flow_id=cluster_creator.output,
step_id="{{ task_instance.xcom_pull(task_ids='add_steps', key='return_value')[0] }}",
aws_conn_id='aws_default',
)

cluster_remover = EmrTerminateJobFlowOperator(
task_id='remove_cluster',
job_flow_id="{{ task_instance.xcom_pull(task_ids='create_job_flow', key='return_value') }}",
job_flow_id=cluster_creator.output,
aws_conn_id='aws_default',
)

cluster_creator >> step_adder >> step_checker >> cluster_remover
step_adder >> step_checker >> cluster_remover
# [END howto_operator_emr_manual_steps_tasks]

# Task dependencies created via `XComArgs`:
# cluster_creator >> step_adder
# cluster_creator >> step_checker
# cluster_creator >> cluster_remover
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

from airflow import DAG
from airflow.operators.dummy import DummyOperator
from airflow.operators.python import BranchPythonOperator
from airflow.operators.python import BranchPythonOperator, get_current_context
from airflow.providers.amazon.aws.transfers.google_api_to_s3 import GoogleApiToS3Operator
from airflow.utils.dates import days_ago

Expand All @@ -53,12 +53,13 @@


# [START howto_operator_google_api_to_s3_transfer_advanced_task_1_2]
def _check_and_transform_video_ids(xcom_key, task_ids, task_instance, **kwargs):
video_ids_response = task_instance.xcom_pull(task_ids=task_ids, key=xcom_key)
def _check_and_transform_video_ids(task_output):
video_ids_response = task_output
video_ids = [item['id']['videoId'] for item in video_ids_response['items']]

if video_ids:
task_instance.xcom_push(key='video_ids', value={'id': ','.join(video_ids)})
context = get_current_context()
context["task_instance"].xcom_push(key='video_ids', value={'id': ','.join(video_ids)})
return 'video_data_to_s3'
return 'no_video_ids'

Expand Down Expand Up @@ -98,7 +99,7 @@ def _check_and_transform_video_ids(xcom_key, task_ids, task_instance, **kwargs):
# [START howto_operator_google_api_to_s3_transfer_advanced_task_1_1]
task_check_and_transform_video_ids = BranchPythonOperator(
python_callable=_check_and_transform_video_ids,
op_args=[task_video_ids_to_s3.google_api_response_via_xcom, task_video_ids_to_s3.task_id],
op_args=[task_video_ids_to_s3.output[task_video_ids_to_s3.google_api_response_via_xcom]],
task_id='check_and_transform_video_ids',
)
# [END howto_operator_google_api_to_s3_transfer_advanced_task_1_1]
Expand All @@ -121,4 +122,7 @@ def _check_and_transform_video_ids(xcom_key, task_ids, task_instance, **kwargs):
# [START howto_operator_google_api_to_s3_transfer_advanced_task_2_1]
task_no_video_ids = DummyOperator(task_id='no_video_ids')
# [END howto_operator_google_api_to_s3_transfer_advanced_task_2_1]
task_video_ids_to_s3 >> task_check_and_transform_video_ids >> [task_video_data_to_s3, task_no_video_ids]
task_check_and_transform_video_ids >> [task_video_data_to_s3, task_no_video_ids]

# Task dependency created via `XComArgs`:
# task_video_ids_to_s3 >> task_check_and_transform_video_ids
2 changes: 1 addition & 1 deletion airflow/providers/apache/beam/.latest-doc-only-change.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b916b7507921129dc48d6add1bdc4b923b60c9b9
d02ded65eaa7d2281e249b3fa028605d1b4c52fb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b916b7507921129dc48d6add1bdc4b923b60c9b9
91f4d80ff09093de49478214c5bd027e02c92a0e
Loading