Airflow Hooks Postgreshook
To patch the postgreshook you must not import from airflow hooks postgres hook import postgreshook.
Airflow hooks postgreshook. Executes sql code in a specific postgres database param sql. Apache airflow apache airflow the airflow logo and the apache feather logo are either registered trademarks or trademarks of the apache software foundation. Using airflow connection from environment instead of db hot network questions is it reasonable to let inquisitive rogues get advantage on perception and investigation outside combat. See the license for the specific language governing permissions and limitations under the license.
From my package operators postgres to local operator import postgrestolocaloperator postgreshook. The sql code to be executed. From airflow import dag from airflow hooks postgres hook import postgreshook form airflow operators python operator import pythonoperator def load. From airflow hooks postgres hook import postgreshook from airflow models import baseoperator from airflow utils decorators import apply defaults.
The asf licenses this file to you under the apache license version 2 0 the license. You may not use this. From airflow hooks postgres hook import postgreshook pg hook postgreshook postgres conn id postgres bigishdata you can take a look at the source code for the hook and you ll see that the postgreshook inherits from dbapihook which has functions such as run insert rows and get cursor that all come from sqlalchemy functionality. Instead import the postgreshook from the location where you actually use the postgreshook.
Python postgreshook run 7 examples found. Utf 8 licensed to the apache software foundation asf under one or more contributor license agreements. Airflow hooks example airflow hooks example. Source code for airflow hooks postgres hook coding.
Create a postgreshook option using the example connection db hook postgreshook example df db hook get pandas df select from my table load task pyhtonoperator task id load python callable my func name above you can. These are the top rated real world python examples of airflowhookspostgres hook postgreshook run extracted from open source projects. Airflow hooks example airflow hooks example.