我们使用的是 Apache 1.9.0。我写了一个雪花钩插件。我已将钩子放在 $AIRFLOW_HOME/plugins 目录中。
$AIRFLOW_HOME
+--plugins
+--snowflake_hook2.py
Run Code Online (Sandbox Code Playgroud)
雪花_hook2.py
# This is the base class for a plugin
from airflow.plugins_manager import AirflowPlugin
# This is necessary to expose the plugin in the Web interface
from flask import Blueprint
from flask_admin import BaseView, expose
from flask_admin.base import MenuLink
# This is the base hook for connecting to a database
from airflow.hooks.dbapi_hook import DbApiHook
# This is the snowflake provided Connector
import snowflake.connector
# This is the default python logging package
import …Run Code Online (Sandbox Code Playgroud)