Skip to content

Commit

Permalink
[AIRFLOW-5691] Rewrite Dataproc operators to use python library (#6371)
Browse files Browse the repository at this point in the history
  • Loading branch information
turbaszek authored and potiuk committed Nov 13, 2019
1 parent 2897624 commit d633d3a
Show file tree
Hide file tree
Showing 15 changed files with 3,175 additions and 2,792 deletions.
11 changes: 6 additions & 5 deletions airflow/contrib/hooks/gcp_dataproc_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,28 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.dataproc`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.dataproc`."""

import warnings

# pylint: disable=unused-import
from airflow.gcp.hooks.dataproc import DataprocHook, DataprocJobStatus # noqa
from airflow.providers.google.cloud.hooks.dataproc import DataprocHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.dataproc`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.dataproc`.",
DeprecationWarning, stacklevel=2
)


class DataProcHook(DataprocHook):
"""
This class is deprecated. Please use `airflow.gcp.hooks.dataproc.DataprocHook`.
This class is deprecated. Please use `airflow.providers.google.cloud.hooks.dataproc.DataprocHook`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. Please use `airflow.gcp.hooks.dataproc.DataprocHook`.",
"This class is deprecated. Please use `airflow.providers.google."
"cloud.hooks.dataproc.DataprocHook`.",
DeprecationWarning, stacklevel=2
)

Expand Down
12 changes: 7 additions & 5 deletions airflow/contrib/operators/dataproc_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.operators.dataproc`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.operators.dataproc`."""

import warnings

# pylint: disable=unused-import
from airflow.gcp.operators.dataproc import ( # noqa
from airflow.providers.google.cloud.operators.dataproc import ( # noqa
DataprocClusterCreateOperator, DataprocClusterDeleteOperator, DataprocClusterScaleOperator,
DataProcHadoopOperator, DataProcHiveOperator, DataProcJobBaseOperator, DataprocOperationBaseOperator,
DataProcHadoopOperator, DataProcHiveOperator, DataProcJobBaseOperator, DataProcJobBuilder,
DataProcPigOperator, DataProcPySparkOperator, DataProcSparkOperator, DataProcSparkSqlOperator,
DataprocSubmitJobOperator, DataprocUpdateClusterOperator,
DataprocWorkflowTemplateInstantiateInlineOperator, DataprocWorkflowTemplateInstantiateOperator,
)

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.operators.dataproc`.",
DeprecationWarning, stacklevel=2
"This module is deprecated. Please use `airflow.providers.google.cloud.operators.dataproc`.",
DeprecationWarning,
stacklevel=2,
)
122 changes: 0 additions & 122 deletions airflow/gcp/example_dags/example_dataproc.py

This file was deleted.

Loading

0 comments on commit d633d3a

Please sign in to comment.
  翻译: