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
1 change: 0 additions & 1 deletion airflow-core/src/airflow/models/xcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
# XCom constants below are needed for providers backward compatibility,
# which should import the constants directly after apache-airflow>=2.6.0
from airflow.utils.xcom import (
MAX_XCOM_SIZE, # noqa: F401
XCOM_RETURN_KEY,
)

Expand Down
1 change: 0 additions & 1 deletion airflow-core/src/airflow/utils/xcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
# https://github.com/apache/airflow/pull/1618#discussion_r68249677
from __future__ import annotations

MAX_XCOM_SIZE = 49344
XCOM_RETURN_KEY = "return_value"
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from collections.abc import Sequence
from typing import TYPE_CHECKING

from airflow.models.xcom import MAX_XCOM_SIZE, XCOM_RETURN_KEY
from airflow.models.xcom import XCOM_RETURN_KEY
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
from airflow.providers.amazon.version_compat import BaseOperator
from airflow.providers.google.common.hooks.discovery_api import GoogleDiscoveryApiHook
Expand All @@ -36,6 +36,10 @@
from airflow.models import TaskInstance as RuntimeTaskInstanceProtocol # type: ignore[assignment]
from airflow.utils.context import Context

# MAX XCOM Size is 48KB
# https://github.com/apache/airflow/pull/1618#discussion_r68249677
MAX_XCOM_SIZE = 49344


class GoogleApiToS3Operator(BaseOperator):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import pytest

from airflow import models
from airflow.models.xcom import MAX_XCOM_SIZE
from airflow.providers.amazon.aws.transfers.google_api_to_s3 import GoogleApiToS3Operator
from airflow.providers.amazon.aws.transfers.google_api_to_s3 import MAX_XCOM_SIZE, GoogleApiToS3Operator

# This test mocks json.dumps so it won't work for database isolation mode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
from typing import TYPE_CHECKING

from airflow.exceptions import AirflowException
from airflow.models.xcom import MAX_XCOM_SIZE
from airflow.providers.google.cloud.hooks.gcs import GCSHook
from airflow.providers.google.version_compat import BaseOperator

if TYPE_CHECKING:
from airflow.utils.context import Context

# MAX XCOM Size is 48KB, check discussion: https://github.com/apache/airflow/pull/1618#discussion_r68249677
MAX_XCOM_SIZE = 49344


class GCSToLocalFilesystemOperator(BaseOperator):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import pytest

from airflow.exceptions import AirflowException
from airflow.models.xcom import MAX_XCOM_SIZE
from airflow.providers.google.cloud.transfers.gcs_to_local import GCSToLocalFilesystemOperator
from airflow.providers.google.cloud.transfers.gcs_to_local import MAX_XCOM_SIZE, GCSToLocalFilesystemOperator

TASK_ID = "test-gcs-operator"
TEST_BUCKET = "test-bucket"
Expand Down