[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eBackport provider packages enable users of Airflow 1.10.* to access new features and security updates for operators, transfers, sensors, and hooks without upgrading to a newer version of Airflow.\u003c/p\u003e\n"],["\u003cp\u003eThese packages are essentially Airflow 2 components (operators, transfers, etc.) packaged as PyPI modules and can be installed or upgraded like any other PyPI package, and are available for Python 3.\u003c/p\u003e\n"],["\u003cp\u003eBackport packages come pre-installed in some Cloud Composer images, but specific versions can be updated if needed, and these cannot be uninstalled, only version changed.\u003c/p\u003e\n"],["\u003cp\u003eOperators from backport packages are categorized as either "new" (not in Airflow 1.10.*) or "moved" (already in Airflow 1.10.*), each requiring distinct import paths in DAG code.\u003c/p\u003e\n"],["\u003cp\u003eTo use backported operators, you must import new operators from their corresponding \u003ccode\u003eairflow.providers.*\u003c/code\u003e package and moved operators from their respective \u003ccode\u003eairflow.contrib.*\u003c/code\u003e package.\u003c/p\u003e\n"]]],[],null,["# Import operators from backport provider packages\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nCloud Composer 3 \\| Cloud Composer 2 \\| **Cloud Composer 1**\n\n\u003cbr /\u003e\n\nThis page explains what [Airflow backport provider packages](https://airflow.apache.org/docs/apache-airflow/1.10.15/backport-providers.html) are and how you can use them in your DAGs.\n\nBackport provider packages are Airflow 2 versions of operators, transfers,\nsensors, hooks, and secrets that are packaged as PyPI modules.\n\nTo simplify things, this document focuses just on operators. You can use all\nother content from a backport package in the same way as shown for operators.\n\nBackport provider packages solve an important problem: you can get new\nfeatures and security updates for operators, transfers, sensors, and hooks\nwithout upgrading your Airflow environment to a later version. For example,\nthe [provider package for Google](https://pypi.org/project/apache-airflow-providers-google/)\nis available in Airflow 2. You can import operators from the\n[backported version](https://pypi.org/project/apache-airflow-backport-providers-google/)\nof this package in your Airflow 1.10.\\* environment.\n\nBefore Apache Airflow introduced the concept of backport provider packages,\noperators were an integral part of Airflow. To get new versions of operators,\nyou needed a newer version of Airflow. This required upgrading your\nCloud Composer environment to a later version. Airflow 2 moves away\nfrom this model and introduces provider packages. A *provider package* for\nAirflow 2 is a PyPI module that contains operators, transfers, sensors, hooks,\nand secrets for a specific provider (for example, Google). If you use Airflow\n1.10.\\*, you can benefit from this change and use backported versions of\nprovider packages.\n| **Note:** Backport packages are only available for Python 3. You might also need to update the way operators are called in your DAG code because backported versions of operators often use a different syntax.\n\nUse preinstalled backport packages\n----------------------------------\n\nSome backport packages are already installed in Cloud Composer\nimages. You don't need to install these backport packages to your environment.\nJust make sure that you import operators from a backport package in your DAG\ncode as described later on this page.\n\nTo check which backport packages are available in your environment, see\nthe [list of packages](/composer/docs/composer-versions)\nin the Cloud Composer image for your environment.\n\nEach preinstalled backport package in your environment has a specific version.\nIf you want to use a different version,\n[update your environment](/composer/docs/composer-2/update-environments)\nand specify the required version. We do not recommend to downgrade\npreinstalled backport packages. Install an earlier version only if you\ndiscover an issue with a later version. You cannot uninstall preinstalled\nbackport packages, only change the installed versions.\n\nInstall and upgrade backport packages\n-------------------------------------\n\nTo install or upgrade a backport package:\n\n1. [Find the required backport package on PyPI.org](https://pypi.org/search/?q=apache-airflow-backport-providers).\n\n2. [Install or upgrade the package](/composer/docs/composer-2/install-python-dependencies#install-pypi) like any other PyPI package.\n\n3. If required, install cross provider package dependencies. These are extra\n dependencies that you might need to use all the features of the backport\n package.\n\n For example, to use `SalesforceToGcsOperator` from\n `apache-airflow-backport-providers-google`, you need the `[salesforce]`\n extra.\n [Install](/composer/docs/composer-2/install-python-dependencies#install-pypi)\n `apache-airflow-backport-providers-google` and specify the `[salesforce]`\n extra in the **Extras and version** field.\n | **Note:** To see a list of cross provider packages, go to the package's page on on PyPI.org. Cross provider packages are listed in the \"Cross provider package dependencies\" section.\n\nImport operators from backport provider packages in DAGs\n--------------------------------------------------------\n\nTo see a list of contents in a backport package, go to the backport package\npage on PyPI.org. For example, the page for\n[`apache-airflow-backport-providers-google`](https://pypi.org/project/apache-airflow-backport-providers-google/)\nlists operators, transfers, sensors, hooks, and secrets for this package.\n\nBackport provider packages introduce new and moved operators and other\ncontent. There is a difference between these two types of content, as\nexplained later.\n\n### Import new operators\n\nNew operators are those that don't exist in Airflow 1.10.\\*. If you try to\nimport such an operator without its backport package, you get an import error.\n\nTo use new operators from a backport package, import them from their\ncorresponding `airflow.providers.*` package, as described on the page for this\nbackport package on PyPI.org.\n\nThe following example imports new operators from the\n[`apache-airflow-backport-providers-google`](https://pypi.org/project/apache-airflow-backport-providers-google/)\npackage: \n\n from airflow.providers.google.cloud.operators.bigquery_dts import (\n BigQueryCreateDataTransferOperator,\n BigQueryDeleteDataTransferConfigOperator,\n )\n\n### Import moved operators\n\nMoved operators are those that already exist in Airflow 1.10.\\*. After you\ninstall a backport operator package, you can import two different versions of\nan operator. One version is bundled with Airflow, and another one is a moved\noperator. To use a moved operator, import it by using a new import path.\n| **Important:** Moved operators from backport packages are still available by their original paths in Airflow 1.10.\\*. If you import an operator by using its original import path, your DAG uses the original version of the operator that is bundled with Airflow.\n\nTo use moved operators from a backport package, import them from a\ncorresponding `airflow.contrib.*` package, as described on the page for this\nbackport package on PyPI.org.\n\nThe following example imports moved operators from the\n[`apache-airflow-backport-providers-google`](https://pypi.org/project/apache-airflow-backport-providers-google/)\npackage: \n\n from airflow.contrib.operators.bigquery_operator import (\n BigQueryCreateEmptyDatasetOperator,\n BigQueryOperator,\n )\n\nWhat's next\n-----------\n\n- [Writing DAGs](/composer/docs/composer-2/write-dags)\n- [Installing PyPI packages](/composer/docs/composer-2/install-python-dependencies#install-pypi)\n- [List of preinstalled packages in Cloud Composer images](/composer/docs/composer-versions)"]]